我打开C:\Python27\python.exe,我打字很干净_索引.py(这是一个位于C:\Python27中的文件)我得到:
>>> clean_index.py
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'clean_index' is not defined
这是怎么回事?
I键入C:\Python27\clean_索引.py,同样的道理。你知道吗
Tags:
使用execfile:
或者直接运行它(不在python shell中):
假设您的路径中有
python
。你知道吗或者,在python shell中使用
import
:从the docs获取的模块导入示例。文件名是
fibo.py
。你知道吗因为您可能只是想运行文件,所以我建议您使用second选项。你知道吗
相关问题 更多 >
编程相关推荐