Module:
A module is essentially a py file.
Divided into three parts: built-in modules, third-party modules (module calls and package concepts)
Find the py file in the interpreter first, then find the file under the installation path Lib, and then find the custom module.
Time stamp:
1970 set a time of 0, time each additional second after +1
So each time can be represented by the following numbers
Print (Time.time ()) to get the current timestamp
Time.localtime Structured time
Greenwich Mean Time:
To convert a timestamp to a structured time:
To convert a structured time to a timestamp:
To convert a structured time to a string time:
Convert string time to structured time:
Another kind
Change string time
Random module
Random display of a number
Random.random floating Point
Random.randint integer
Randomly displays one of the following three parameters
Various uses
Sample followed by a list, write a parameter in the back
Randomly select the number of arguments in the list.
Shuffle randomly, change the order of the list randomly
Convert numbers to letters by function
and convert the letters into numbers
Random display of 5 letters + digits + Capital letters verification Code
Hashlib, MD5
MD5 (32-bit)
Update can be constantly update
The hexdigest in the back can add the above cumulative
Website Storage account password Do MD5 can be added salt processing, in order to avoid the account password is hit library
Add salt to admin
OS Module
Two things: Work down the hardware and provide an interface up.
Show current directory Address
GETCWD changes the current directory address, which changes the address where the directory was created.
R native String, do not translate
Displays all file contents under the path and is born into a list
The file cannot be opened by operation when renaming.
Displays file information, RET is an object that can be added. St_mtime and so on.
St_ctime creation Time St_mtime Modify time St-atime access time st_size size (bytes)
The Os.path.split path and file name are saved separately as a single tuple.
Take DirName or basename alone
Python Learning notes Section 12th