【发布时间】:2011-07-28 09:16:25
【问题描述】:
我有一个问题,如果我双击我的脚本 (.py),或者用 IDLE 打开它,它会编译并正确运行。但是,如果我尝试在我的 Windows 命令行中运行脚本,使用
C:\> "C:\Software_Dev\Python 2.7.1\python.exe" C:\path\to\script\script.py
我明白了……
Traceback (most recent call last):
File "C:\path\to\script\script.py", line 66, in <module>
a.CheckTorrent()
File "C:\path\to\script\script.py", line 33, in script
self.WriteLog(fileName)
File "C:\path\to\script\script.py", line 54, in WriteLog
myFile = open(r'%s' %(filename), 'w')
IOError: [Errno 13] Permission denied: './TorrentMonitor.log'
所以我的问题是,为什么我在窗口 7 中通过命令行运行此脚本时会出现权限错误,但双击时却没有?这两个流程有什么区别?
提前致谢!
【问题讨论】:
标签: python command-line windows-7