简体   繁体   中英

How to run a python script in IDLE using CMD prompt

I am wondering if there is a way to open a python script in IDLE run mode, (the equivalent of opening it with idle.exe {path} and pressing F5) or set it up so that if a.py file is open with IDLE it automatically runs it.

#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

You might consider using:

# Inspect interactively after running script (see "python --help" from cmd)
python -i script.py

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM