简体   繁体   中英

Python command-line mode error

I have some difficulties trying to run the python programs from cmd, or command-line. When i double click the python program it display the cmd for some seconds in fact less than 3 Seconds, and cmd disappeared. I can only run by right clicking on it then edit in idle and run model command. Only from the python shell. And how to give path for python shell to find applications, for instance just type the program name and it runs. Do python have GUI as exe programs?

First make sure python.exe is in your path .
Then type in the command prompt ( cmd ) python "path\\to\\program.py"

If you want to just type the progam name, you have two options.

  1. Add the folder containing your program to your path.
  2. Right click in the folder while holding shift, and then click "open command prompt here"

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