It took a few days for the command line to know the idle thing.
After opening Python 2.7 There are three command windows:IDLE (python GUI), Python (comand line), Module Docs.
Module Docs is a search box that can search for functions that are not known in Python.
Compare idle with command line: both interactive mode
IDLE (python GUI):
White window. There are code highlighting, auto indent, code hints and menu bar;
You can create a new Python file, copy and paste the code, but not return the results;
You cannot repeat the previous command with the UP arrow.
Python (comand line):
Black window, only after the execution of the error prompt.
No menu bar, only one line to type the command, paste a piece of code will be disassembled to a single command execution ;
Cannot paste the tab and space after for, will error.
Use the up arrow to reproduce the previous command faster.
Double-click the run file: To get rid of script mode and write code directly, first add the Python installation location to the environment variable path. You can then double-click to open the. py file. Workaround: add raw_input () or input () to the end of the. py file according to the version.
Two ways to run a. py file on the command line:
cmd: switch to the path where the file is located, execute: Python myname.py
Python.exe:
Import OS
Os.chdir (' current path ')//Switch to current path
OS.GETCWD ()//Get current path
Run: execfile (' myname.py ')
or Direct:execfile (entire path name + file name)
If you use import myname.py, you can only return execution results on the first import, and the import will error.
Copyright NOTICE: Welcome reprint, Reprint please indicate the source http://blog.csdn.net/ztf312/
What is the difference between Python IDLE (python GUI) and Python (comand line)