Open a text file using notepad as a help file in python?

后端 未结 6 1949
攒了一身酷
攒了一身酷 2020-11-29 08:28

I would like to give users of my simple program the opportunity to open a help file to instruct them on how to fully utilize my program. Ideally i would like to have a littl

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-29 08:47

    You can do this in one line:

    import subprocess
    subprocess.call(['notepad.exe', 'file.txt'])
    

    You can rename notepad.exe to the editor of your choice.

提交回复
热议问题