How do I modify program files in Python?

前端 未结 4 2140
囚心锁ツ
囚心锁ツ 2021-01-29 16:32

In the actual window where I right code is there a way to insert part of the code into everyline that I already have. Like insert a comma into all lines at the first spot>?

4条回答
  •  日久生厌
    2021-01-29 16:36

    You need a file editor, not python.

    1. Install the appropriate VIM variant for your operating system
    2. Open the file you want to modify using VIM
    3. Type: :%s/^/,/
    4. Type: :wq

提交回复
热议问题