Problem using os.system() with sed command

后端 未结 7 2173
耶瑟儿~
耶瑟儿~ 2020-12-20 04:30

I\'m writing a small method to replace some text in a file. The only argument I need is the new text, as it is always the same file and text to be replaced.

I\'m hav

7条回答
  •  情歌与酒
    2020-12-20 04:54

    To help you debug it, try adding:

    print repr(cmd)
    

    It might be that some special characters slipped into the command that normal print is hiding when you copy and paste it.

提交回复
热议问题