Author:maddock
Date:2015-03-15 21:42:01
(not organized at the moment)
Repeat the previous command
If you want to repeat the previous command in the Idle main window, you can use the ALT-P key combination to rollback, find the command line history, and use Alt-n to look forward
(On your Mac, you can try using Ctrl-p and ctrl-n).
The previous command can be recalled and displayed, and can be edited and run after the change.
Directory switching
Using the Os.chdir method, the following code for Linux,windows also applies # Get current directory >>> import os>>> os.getcwd () '/home/piglei ' # Change working directory > >> os.chdir ("/dev") >>> os.getcwd () '/dev '
Run the. py file in the shell
>>> import OS load OS module >>> os.chdir ("X:\XXX\YYY ...") Add your folder path Note the quotation marks on both sides of the path >>> execfile ("xxx.py ") Open your py file in this path
Run the Python program in sublime Text2 Press CTRL + B
Python Learning Notes