【发布时间】:2014-10-22 21:51:36
【问题描述】:
当我尝试使用 Alt+Ctrl+Enter 在交互式控制台中运行代码时,会出现该错误
Traceback (most recent call last):
File "<input>", line 1, in <module>
NameError: name 'runfile' is not defined
使用 python 2.7.6 日食4.4 PyDev 3.7
【问题讨论】:
-
点击运行->运行或者Ctrl+F11会出现这种情况吗?
-
不,它在默认控制台中完美运行
-
Run->'Run Configuration' MainModule 字段中有什么?
-
${workspace_loc:andre/and.py}
-
我在 Window->Preferences->PyDev->Interactive Console 中有这个:“import sys; print('%s %s' % (sys.executable or sys.platform, sys.version ))" sys.executable 将用于运行您的代码,并且可能添加这将有助于您的代码。你可以试试看。
标签: python eclipse eclipse-plugin pydev