1. Embed double and single quotes in a string
use the escape character "\"
Example:
2. Print Numbers:0001~0009 This form
Example:
3. strip () Action string method in Python
Example:str= "Hello hai haisljkdj"
1) Str.strip (): Remove the string header and trailing spaces and \ n and \ t
2) str.strip (' Hai '): Delete the string from the beginning or the end with the Hai character
3) Str.rstrip (): Delete trailing space
4) Str.lstrip (): Delete the beginning of the space
4. Take the string apart into the list
5. use split to split the string
Example:
6. OS ( renaming, judging existence, getting address )
Example:
Import OS
Os.rename (' 12.txt ', ' 456.txt '): Change file name
Os.system ("Copy 1.txt 2.txt"): Copying Files
Os.path.exists (' 1.txt '): Determine if the file exists
Os.path.exists (' D:\\test '): Determine if a folder exists
OS.GETCWD (): Gets the path of the current file
Os.path.join ("C:\\test", "Log.txt"): Connect two addresses together
7. Python Delete List element method
Example:
Python tips for using