Learning content
- Module Introduction
- Time &datetime Module
- Random
- Os
- Sys
- Shutil
- JSON & Picle
- Shelve
- XML processing
- YAML processing
- Configparser
- Hashlib
- Subprocess
- Logging module
- Re-regular expression
One: module introduction
The modules are divided into three types:
- Custom Modules
- Built-in standard module (also known as standard library)
- Open source Module
Custom modules Use
#-*-coding:utf-8-*-__author__='Shisanjun'"""Day4 and Day5 are test2 below the directory day5 in the sibling directory and need to call the index function under Day4.decorator1"""ImportOSImportSYS"""Os.path.abspath (__file__): Absolute path Os.path.dirname (Os.path.abspath (__file__)): File is located in the parent directory Os.path.dirname (OS. Path.dirname (Os.path.abspath (__file__)): The parent directory on which the file resides (Day4,day5 can be called)"""Base_dir=os.path.dirname (Os.path.dirname (Os.path.abspath (__file__)) ) sys.path.append (base_dir)#Add the upper parent directory to the system directory environment fromDay4.decorator1ImportIndex#If there are no above two steps, the imported module will report no Mouldeindex ()
Two: Time &datetime module
1) How to use the time module
Python Basic Learning Log Day5