The encapsulated function is the module (library).
There are two types of libraries:
Standard library, do not need to install the library can be imported directly;
Third-party libraries that must be installed.
Primary Knowledge Standard Library
Sys
Import SYS Print (Sys.path)
To adjust the function through the "library name, function name" implementation
Third-Party inventory path: D:\Program files\python\python3.5\lib\site-packages
Standard inventory drop path: D:\Program files\python\python3.5\lib
Take parameters
Import SYS Print (sys.argv[2]) F:\PycharmProjects\lesson\week2>python sys_mod.py 1 2 32
View files in the current directory
Cmd_res=os.system ("dir")# executes the command without saving the result Cmd_res=os.popen (" dir "). Read ()#read () Use this method to fetch the result print(cmd_res) os.mkdir ("new_ Dir")# Add a new directory
Calling third-party modules
Import Module Name
This module can be placed in the \python3.5\lib\site-packages, or add the path of the third-party module
Python 02-Modules