6 libraries that Python programmers need to know
1.Pyglet
What is: Pyglet is a cross-platform framework written in pure Python language, used to develop multimedia and Window special effects are applied.
Why it is needed: Developing the functional modules required for graphical interface applications from scratch is very cumbersome. Pyglet provides a large number of ready-made modules, saving a lot of time: window functions, OpenGL special effects, audio and video playback, keyboard and mouse processing and image processing. (However, Pyglet does not provide UI components such as buttons, toolbars or menus.)
All the above modules are implemented natively under Windows, OSX or Linux platforms , does not rely on external binary packages; it is written in pure Python. Pyglet is released under the BSD license and can be used in any commercial and open source projects. If you want to learn python, you can come to this group, 472, 309, 261. There are a lot of learning materials you can download.
2.Peewee
What is: Peewee is a small but very powerful library that supports database access through ORM and natively supports SQLite and MySQL and databases such as PostgreSQL.
Why it is needed: Any application that needs to frequently use external data will basically use a database, but reading and writing data from the database through temporary connections will cause a lot of trouble.
Peewee provides a safe and stable channel to access database resources. For Python programmers and database engineers, the Python classes provided by this library will be
handy. With the support of Peewee, we can access the database quickly and easily, and can be expanded to add more options in the future without redesigning. Peewee also natively supports database transactions and has many optional additional modules, providing everything from database connection pooling to advanced fields like many-to-many. Type and other functions.
If you want to learn python, you can come to this group, 472, 309, 261. There are a lot of learning materials that can be downloaded.
3.Bottle
What it is: Bottle is a small, lightweight network development framework that is also very fast.
Why you need it: If you just want to quickly create a Restful
APIinterface, or just want to use a network development framework to make a simple application, Bottle can easily to meet your requirements. It has all the features you will need: routing, templates, accessrequest and response
data (request and response data), support for multiple network servers, and advanced features such as WebSockets Function.
Creating an application requires very little work, and Bottle is designed with scalability in mind. If you need more advanced features, you can access them at any time.
4.Invoke
What it is: Simply put, Invoke allows you to easily perform system management tasks through a Python library.
Why you need it:
Who doesn’t want a “concise, high-level interface that can run shell commands, define and categorize execution tasks”? It is completely reasonable to use Python to replace ordinary shell scripts and perform corresponding tasks. Invoke provides solutions for performing common command line tasks and managing them. For Invoke, each management task is like a Python function, and more complex tasks can be designed elegantly on this basis.
It should be noted that Invoke is still a preview version; if you want to use a stable tool (even if it is no longer actively developed), you can consider Invoke's predecessor-Fabric.
5.Splinter
What it is: Splinter is a Python library for automated testing of network applications.
Why you need it: As we all know, there is nothing more boring than automated web application testing. With Splinter, you can automate all operations such as opening a browser, entering a URL, filling in a form, and clicking a button.
Specific browsers need to use corresponding drivers, but fortunately Chrome and Firefox drivers are already included. In addition, Splinter can also remotely control browsers on other machines through Selenium Remote. You can even manually execute JavaScript code in the target browser.
If you want to know the specific situation of a certain browser when browsing a specified website, then Splinter will be a very useful tool. If you want to learn about interacting with websites without relying on a browser, check out Twill. (Translator: Twill is a scripting language that supports users to browse the network through the command line.)
6.Arrow
What is: Arrow is a library that can better handle dates and times in Python (data/time ).
Why you need it: Dealing with time zones, date conversions, dealing with different date formats, and other date-related stuff is enough to give you a day and a half of headaches. If you use the modules in the standard library that comes with Python, you will probably have a headache for two days.
There are four major benefits to using the Arrow library, which are very useful in both the long and short term. First, it can perfectly replace the datetime module in Python, which means you can still use common function call forms like .now() and .utcnow().
Second, it provides methods to meet common needs such as converting time zones. Third, it provides "human-friendly" date/time information - that is, it can easily tell you whether something happened "one hour ago" or "will happen in two hours" . Fourth, it easily converts date/time information to local time.
The above is the detailed content of 6 libraries that Python programmers need to know. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics





PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

VS Code can be used to write Python and provides many features that make it an ideal tool for developing Python applications. It allows users to: install Python extensions to get functions such as code completion, syntax highlighting, and debugging. Use the debugger to track code step by step, find and fix errors. Integrate Git for version control. Use code formatting tools to maintain code consistency. Use the Linting tool to spot potential problems ahead of time.

VS Code can run on Windows 8, but the experience may not be great. First make sure the system has been updated to the latest patch, then download the VS Code installation package that matches the system architecture and install it as prompted. After installation, be aware that some extensions may be incompatible with Windows 8 and need to look for alternative extensions or use newer Windows systems in a virtual machine. Install the necessary extensions to check whether they work properly. Although VS Code is feasible on Windows 8, it is recommended to upgrade to a newer Windows system for a better development experience and security.

VS Code extensions pose malicious risks, such as hiding malicious code, exploiting vulnerabilities, and masturbating as legitimate extensions. Methods to identify malicious extensions include: checking publishers, reading comments, checking code, and installing with caution. Security measures also include: security awareness, good habits, regular updates and antivirus software.

Python is more suitable for beginners, with a smooth learning curve and concise syntax; JavaScript is suitable for front-end development, with a steep learning curve and flexible syntax. 1. Python syntax is intuitive and suitable for data science and back-end development. 2. JavaScript is flexible and widely used in front-end and server-side programming.

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

In VS Code, you can run the program in the terminal through the following steps: Prepare the code and open the integrated terminal to ensure that the code directory is consistent with the terminal working directory. Select the run command according to the programming language (such as Python's python your_file_name.py) to check whether it runs successfully and resolve errors. Use the debugger to improve debugging efficiency.
