简体   繁体   中英

How to quit the interpreter in python?

I'm having this exact beginner problem. syntax error when using command line in python

As suggested I try to quit the interpreter. But when I try to quit the interpreter/shell with exit() or ctrl d the whole Python2.7.6 Shell and c:/python27/python.exe gets closed unlike in the Pyquick video tutorial I'm watching.

You need to run your Python files from a Windows command line prompt (Start > Run > "cmd").

Note that in said command line prompt, you can open an interactive Python session by typing "python" and hitting return.

Also, for all of that to work, you'll have to make sure Python is in your $PATH (Control Panel > System and Security > System, click "Advanced System Settings", "Environment Variables", find "Path" in the list and add C:\\Python27\\ to the list of paths).

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