嘗試打開txt時出現此錯誤。文件。請告訴如何解決它。打開子進程python時發生錯誤
code: subprocess.Popen("/home/yash/Documents/ct.txt")
time.sleep(1)
error:
Traceback (most recent call last):
File "/home/yash/Documents/final_downloader22.py", line 5, in <module>
subprocess.Popen("/home/yash/Documents/ct.txt")
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
感謝您的回覆,我正在運行linux,我想用gedit打開它來編輯任何進一步的幫助。 – user1779646
@ user1779646然後調用'gedit'並告訴它加載txt文件:'subprocess.Popen(['gedit',「/home/yash/Documents/ct.txt」])''。 – glglgl
它的工作,謝謝。 – user1779646