![](/img/trans.png)
[英]Python script working in IDLE, but not working when run from CMD or Eclipse
[英]How to run a python script in IDLE using CMD prompt
我想知道是否有办法在 IDLE 运行模式下打开 python 脚本(相当于用 idle.exe {path} 打开它并按 F5)或设置它以便如果 a.py 文件以 IDLE 打开它会自动运行它。
#Opens without IDLE GUI
python {path}
#Opens in IDLE, but in editor mode
@ECHO OFF
idle.exe {path_to_idle}
# Running script.py in idle
idle.exe -r script.py
您可以考虑使用:
# Inspect interactively after running script (see "python --help" from cmd)
python -i script.py
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.