Several third-party Python libraries I commonly use

Source: Internet
Author: User
Tags image processing library wxwidgets
MSO-Hansi-font-family: "Times New Roman" '> several third-party
Python MSO-Hansi-font-family: "Times New Roman" '> Library

MSO-Hansi-font-family: "Times New Roman" '> by: Lai Yong Hao (http://blog.csdn.net/lanphaday "Times New Roman"'>)

MSO-ascii-font-family: "Times New Roman"; MSO-Hansi-font-family: "Times New Roman" '> today, the company has a power outage and is not working. Run to update a blog and share with you some of my frequently used third-party Python "Times New Roman"; MSO-Hansi-font-family: "Times New Roman" '> libraries. Python "Times New Roman"; MSO-Hansi-font-family: "Times New Roman" '> language is so popular that many built-in libraries ensure rapid development, third-party libraries that are not accessible are also a major cause. In combination with my current work (online game development), I usually use the following third-party libraries:

Wxpython

MSO-ascii-font-family: "Times New Roman"; MSO-Hansi-font-family: "Times New Roman" '> if you used to be windows "Times New Roman "; MSO-Hansi-font-family: "Times New Roman" '> programmers use mfc mso-Hansi-font-family: "Times New Roman" '> or WIN32API "Times New Roman"'> interface program development, go to Python "Times New Roman" '> the best GUI in the country "Times New Roman"'> select wxpython "Times New Roman" '>. It is the python bind of wxWidgets "Times New Roman" '>, and is perfectly synchronized with the development of wxWidgets "Times New Roman"'>, the most important thing is that its message mechanism is quite similar to that of MFC "Times New Roman" '>, previous experiences in MFC "Times New Roman" '> can be applied to wxpython "Times New Roman"'> with slight changes. In Win32 "Times New Roman" '> development, the most annoying part must be wm_size "Times New Roman"'> message. When the size of the Main Window changes, maintaining the control layout in Win32 "Times New Roman" '> is a headache. WX "Times New Roman" '> the solution is perfect, its sizer "Times New Roman" '> concept allows me to easily maintain a perfect control layout with different window sizes. In addition, if you hate mfc mso-Hansi-font-family: "Times New Roman" '> doc-View "Times New Roman"'> model, wx; MSO-ascii-font-family: "Times New Roman"; MSO-Hansi-font-family: "Times New Roman" '> you can also choose a new one; if you really like Doc-View "Times New Roman"; MSO-Hansi-font-family: "Times New Roman" '> model, rest assured, the wx MSO-Hansi-font-family: "Times New Roman" '> can still be easily implemented, and the previous ideas can still be used here.

Wxpython "Times New Roman" '> two packages are available: pythoncard "Times New Roman"'> and Dabo "Times New Roman" '>. The former is a limited encapsulation of wxpython "Times New Roman" '> and does not support all features of wxpython "Times New Roman"'>, its goal is to make wxpython "Times New Roman" '> More pythonic "Times New Roman"'>. The latter is much larger than pythoncard "Times New Roman" '>. Specifically, it should be a three-tier architecture C/S "Times New Roman"'> development framework. If you want to develop database-based applications (such as MIS "Times New Roman" '>, ERP; MSO-ascii-font-family: "Times New Roman "; MSO-Hansi-font-family: "Times New Roman" '>, etc.) using dabo MSO-Hansi-font-family: "Times New Roman"'> is a good choice; in addition, if you are used to vbmso-Hansi-font-family: "Times New Roman" '>, VFP "Times New Roman"'>, Delphi "Times New Roman" '>, Rad rad; MSO-ascii-font-family: "Times New Roman"; MSO-Hansi-font-family: "Times New Roman" '> development environment, dabo MSO-Hansi -Font-family: "Times New Roman" '> it's not much worse than these expensive tools!

Py2exe

MSO-ascii-font-family: "Times New Roman"; MSO-Hansi-font-family: "Times New Roman" '> follow the evil windows "Times New Roman "; MSO-Hansi-font-family: "Times New Roman" '> thinking, write an application if it is not compiled. exe mso-Hansi-font-family: "Times New Roman" '> files may not be "software", py2exe
MSO-Hansi-font-family: "Times New Roman" '> the role is to take your. PY "Times New Roman" '> the script is changed. EXE "Times New Roman" '> file, usually it will package the script into. zip "Times New Roman" '> file, but you can also modify setup. PY "Times New Roman" '> the script packs all the scripts and dependent DLL "Times New Roman"'> into an EXE "Times New Roman" '>, looks like VC "Times New Roman" '>, VB; MSO-ascii-font-family: "Times New Roman"; MSO-Hansi-font-family: "Times New Roman" '> the compiled program is no different!

MSO-ascii-font-family: "Times New Roman"; MSO-Hansi-font-family: "Times New Roman" '> if your customer needs to go to Windows "Times New Roman"; MSO-Hansi-font-family: "Times New Roman" '> Use your application, py2exe "Times New Roman"; MSO-Hansi-font-family: "Times New Roman" '> is an indispensable tool. I use it to package gadgets written by wxpython for game planning in the company.

Psyco

MSO-ascii-font-family: "Times New Roman"; MSO-Hansi-font-family: "Times New Roman" '> the script execution efficiency is somewhat unsatisfactory, although optimization is not difficult, if there is a simple method that almost does not need to modify the source code, it is worth noting. Psyco MSO-Hansi-font-family: "Times New Roman" '> the magic is that it only needs to call two lines of code at the entrance of the Code, performance can be improved by 40% MSO-Hansi-font-family: "Times New Roman" '> or more!

MSO-ascii-font-family: "Times New Roman"; MSO-Hansi-font-family: "Times New Roman" '> if your customers think your program is slow, don't rush to optimize the code. psyco MSO-Hansi-font-family: "Times New Roman" '> may make him change his mind immediately. Psyco
MSO-Hansi-font-family: "Times New Roman" '> called the JIT of Python "Times New Roman"'>; MSO-ascii-font-family: "Times New Roman"; MSO-Hansi-font-family: "Times New Roman" '> there is a lot of potential to be explored. If there is not much time left to optimize your performance, please read its manual immediately. There are many tips to easily optimize performance.

PIL

PIL "Times New Roman" '> is the image processing library of Python "Times New Roman"'>. In my opinion, the image processing library is as simple as being hard to say. It can open dozens of image formats, common JPG/PNG/BMP "Times New Roman"; MSO-Hansi-font-family: "Times New Roman" '> and so on. In addition, it provides many image processing functions, such as enhancement and filtering algorithms, for details, refer to my previous article "using Python" Times New Roman "; MSO-Hansi-font-family: "Times New Roman" '> Image Processing (http://blog.csdn.net/lanphaday/archive/2007/10/28/1852726.aspx "Times New Roman"'>) and computing image similarity (http://blog.csdn.net/lanphaday/archive/2008/04/24/2325027.aspx "Times New Roman" '> ).

Mysqldb

MSO-ascii-font-family: "Times New Roman"; MSO-Hansi-font-family: "Times New Roman" '> This is Python "Times New Roman "; MSO-Hansi-font-family: "Times New Roman" '> for open-source databases MySQL "Times New Roman"; MSO-Hansi-font-family: "Times New Roman" '> support, official website in http://sourceforge.net/projects/mysql-python "Times New Roman"'>. MySQL 3.23-5.1 "Times New Roman" '> full-range version. For Python "Times New Roman"'>, the version must be 2.3-2.5 "Times New Roman" '>. Mysqldb "Times New Roman" '> is the implementation of Python dB API-2.0 "Times New Roman"'>, It is very mature now. The latest version is 1.2.2 MSO-Hansi-font-family: "Times New Roman" '>.

MSO-ascii-font-family: "Times New Roman"; MSO-Hansi-font-family: "Times New Roman" '> if you are engaged in server development, do not deal with the database connection pool. You can use
Dbutils "Times New Roman"; MSO-Hansi-font-family: "Times New Roman" '> or jonpy MSO-Hansi-font-family: "Times New Roman" '> two open source libraries. Dbutils
MSO-Hansi-font-family: "Times New Roman" '> is a set of database connection pool libraries, while jonpy
MSO-Hansi-font-family: "Times New Roman" '> includes cgi "Times New Roman"'> and database connection pools, please read the manual and select your own library.

Pyprocessing

Python "Times New Roman" '> Gil "Times New Roman"'> (Global interpreter lock) this makes Python "Times New Roman" '> A little embarrassing in the multi-core era-this scripting language that supports native threads cannot use multiple CPUs through multithreading MSO-Hansi-font-family: "Times New Roman" '> concurrent kernel computing. Pyprocessing
MSO-Hansi-font-family: "Times New Roman" '> no attempt to remove Gil "Times New Roman"'>, try the multi-process method to help Python "Times New Roman" '> Get Out Of the predicament. The result is that the use of pyprocessing "Times New Roman" '> communication between processes is as simple as using the built-in threading "Times New Roman"'> module. Pyprocessing "Times New Roman" '> not only can the local socket "Times New Roman"'> communicate with the pipeline, but also can be encapsulated perfectly, its Queue "Times New Roman" '> is similar to the built-in queue "Times New Roman"'>, but it is a queue shared between processes!

Pyprocessing "Times New Roman" '> In py2.6 "Times New Roman"'> and py3.0 "Times New Roman" '>, this is also the development community's affirmation of the pyprocessing "Times New Roman" '> project. If you use Python "Times New Roman" '> to develop server applications, especially for online games, pyprocessing "Times New Roman"'> How can you ignore it!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.