[英]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.