Python learning Manual: Python learning notes day 1, python learning Manual
Obtain the current directory path:
Import OS
OS. getcwd ()
When entering a python program, try to keep statements that are not nested structures at the leftmost, or the system may encounter a "SyntaxError" error.
Obtain the system platform Name:
Import sys
Print (sys. platform)
Stream redirection: Export python output data to other files: python ***. py> test.txt
To avoid program flash on windows, add: input () at the end of the Code ()
Python3.x to simulate the input (evaluate the string) in python2.x, use eval (input ())
If you want python to run the file again in the same session (do not stop or restart the Session), you need to call the reload function in the imp standard library module (2. x is built-in, 3. x is not built-in)
From imp import reload
Reload (***)