Module is the code that encapsulates a particular function.
The modules are divided into three types:
1. Custom Modules
2; third-party modules
3. Built-in Modules
One, custom module
test.py
#!/usr/bin/env python
#-*-Coding:utf-8-*-
Print ("I am Test")
Print ("I am Test1")
Print ("Hello World")
sys.py (the file calls the test module)
#!/usr/bin/env python
#-*-Coding:utf-8-*-
Import Test
Second, third-party modules
The third module is unclear
Three, built-in modules
Anyway a lot, here only three records are getpass, OS, sys
1. load a simple module getpass (Note: This notation is not available in Pycharm )
#!/usr/bin/env python
#-*-Coding:utf-8-*-
#写一个简单模块, this module is not available in Pycharm
Import Getpass
Username = input ("Username:")
Password = getpass.getpass (' Password: ')
Print (Username,password)
2. Loading an OS module
#!/usr/bin/env python
#-*-Coding:utf-8-*-
Import OS
Os.system ("Df-h")
3. Load SYS module
#!/usr/bin/env python
#-*-Coding:utf-8-*-
Import Sys
Print (Sys.path)
This article is from "think one or two" blog, please be sure to keep this source http://250919938.blog.51cto.com/962010/1907473
A preliminary knowledge of Python common modules