Python study notes-day6-[sys module, method of importing modules]

 

Record the usage of the sys module, it is not difficult to look at, but it is easy to forget.

 

1. sys module

1. Common usage

 

2. How to import python files of other modules

 

 

3. Import the python module in the same directory

 

4. Import method 2

 

 

5. You can put the modules you need to import into any directory in the python environment variable, but it is too troublesome to do so

 

 6. Add the directory of the imported module to the Python environment variable, and you can

 

 

 

 Second, sys.argv usage

1. The meaning of sys.argv

 

2. Used to judge the validity of the parameters executed from the command line, sample code

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324629690&siteId=291194637