current position：Home>The three main modules of Python that novice Xiaobai should know
The three main modules of Python that novice Xiaobai should know
This article introduces the three main modules of Python in detail. Through the detailed introduction, they can all have certain reference value for everyone's study or work.
In python, a file (a file with the suffix ".py") is called a module, and each module is regarded as a separate file in python.
A module can be used by other modules in the project, some scripts or even interactive parsers. It can be referenced by other programs to use functions such as functions in the module. The standard library in Python also uses this method.a method.
Let's talk about the main three types of Python modules:
1. System built-in modules
os module: The os module contains common operating system functions
sys module: provides a series of variables and functions related to the Python runtime environment
random module: the random module is used to generate random numbers
time module: mainly contains various classes and functions that provide date and time functions
datetime module: a high-level wrapper around the time module
shutil module: is a high-level file manipulation tool
logging module: prints logs to stdout
re module: can be called directly to achieve regular matching
pymysql module: connect to the database and implement simple addition, deletion, modification and query
threading module: provides a more powerful multi-thread management solution
queue module: implements a multi-producer, multi-consumer queue
json module: used to convert between strings and data types json
Of course there are other modules, you can continue to add in the comment area.Since each module has a lot of content, there is no example to introduce in detail, you can search for it on Google.
2. Open source (three-party) module
Requests: The most famous http library.Every Python programmer should have it.
Scrapy: This library is also essential for crawler-related work.
NumPy: Provides many advanced mathematical methods for Python.
matplotlib: A library for plotting data.Very useful for data analysts.
Pygame: It can be used when developing 2D games.
Scapy: A packet detection and analysis library written in Python.
Django: An open source web development framework that encourages rapid development and follows the MVC design with a short development cycle.
Py2exe: Convert python scripts into executable programs that can be run independently on windows.
BeautifulSoup: Python-based HTML/XML parser, easy to use.
PyGtk: Python-based GUI program development GTK+ library.
Of course, there are many common libraries in the three-party library. I hope you can continue to add them in the comment area.
3. Custom modules
A custom module is a module written by yourself, which encapsulates a certain piece of logic or certain functions for other functions to call.
Note: The name of the custom module must not be the same as the built-in module of the system, otherwise it will not be able to import the built-in module of the system.
For example: After customizing a sys.py module, you cannot use the system's sys module.
author[q56731523],Please bring the original link to reprint, thank you.
The sidebar is recommended
- python3.7scrapy install scrapy with pip command
- python3.7 'pip3' is not an internal or external command, nor is it a runnable program or batch file
- How to use filters and algorithms to restore pictures and decontaminate pictures in image processing/computer vision/python environment [with code]
- Image processing/computer vision/python environment/machine learning k-nearest neighbor method (KNN), template matching algorithm for data set recognition
- Python from entry to practice - 02 list of basic data types
- Python from entry to practice----01 basic data types
- Image processing/computer vision/python environment/how to deal with noise with four different filters [with code, effective for personal testing]
- Private and public members in python
- Python learning functions, lists and tuples, dictionaries
- How to install python3.11 on windows and use python3.11 to run a quantitative trading strategy written by backtrader and increase the speed by about 20%?
guess what you like
Mastering Python in 100 Days (Data Analysis) - Day 63: Pandas Using Custom Function Cases
"Python core technology and actual combat" indispensable custom functions and anonymous functions [functional programming important map(), filter(), reduce()]
Is it hard to make games in Python - let's see how much fun I make
The most complete in history - Python installation tutorial
#Scientific Research Foundation# Python Beginner's Notes for Self-Use Part 4 Tuples, Dictionaries and Sets
#Scientific research building base# Python beginner's self-use notes Part 3 Conditional Statements and Loop Statements
Nested loop in Python
openGauss 2.1.0 upgrade 3.1.0 encountered Exception: [GAUSS-52200] : When compiling python error
Selenium+python to do web-side automated testing framework and example detailed tutorial
Python Regular Expression
- I wrote a financial data crawler in Python, and I did the work of the interns for a week in half an hour
- Python project combat - bank ATM system (3)
- Python decimal to binary function_python hexadecimal to binary
- Python toolbox series (12)
- python automatic send mail script
- [Study Notes] Introduction to Deep Learning: Theory and Implementation Based on Python
- How python handles program exceptions
- Python Volunteer Management System Based on PHP+MySQL
- python is based on PHP+MySQL university asset management system
- Python is based on PHP+MySQL reading sharing platform
- Python student association management system based on PHP+MySQL
- Notes for python importing other modules under windows
- What exactly does Python's __pycache__ cache?Can the historical running results be cached?- A little research on PyCache
- Compare similarity of two vectors - python
- Boutique flower sales shopping mall applet based on Python
- python get all files in current directory
- python gets computer CPU, motherboard, BIOS, hard disk serial number, host name, IP, Mac address
- python get computer unique identifier
- Python converts strings to hexadecimal (encryption and decryption)
- python based on PHP+MySQL college students job recruitment website
- Linear sieve prime number template (Python/C++)
- python university student health management system based on PHP+MySQL
- Python Deep Learning in Action: Testing Neural Networks
- UE4 gets HTTP interface data (UE4 communicates with python)
- Ask a complex text processing problem Python
- Talking about list creation and list element addition and deletion in Python
- Python finds the average mutual information of English text
- Python performance optimization example exercise
- python script rewrite yaml
- Python NotImplementedError: cannot instantiate 'PosixPath' on your system
- How far can a Python novice learn to do automation?
- [Bluebridge Cup for Python] day_008: Huffuman tree
- Install the GDAL library in Python
- Python classic questions finishing
- Python - function design and use
- October 2022 Python Cabin Programming Contest Winners List (Free 5 Books)
- Introduction to Python Interesting Algorithms - Newton's Iterative Method to Find Equation Roots
- Introduction to Python Fun Algorithms - Catch Traffic Accidents & Best Deposit Schemes
- Python writes a small game: snake chess (below)
- Introduction to Python Interesting Algorithms - Rabbit Childbirth (Intrinsic Logic of Fibonacci Sequences)