A few common Third-party Python libraries __python

Source: Internet
Author: User
Tags image processing library wxwidgets

WxPython
If you have previously been a Windows programmer, using MFC or WIN32API to develop interface programs, the best GUI choice to enter the Python country should be wxPython. It is WxWidgets Python Bind, and the development of WxWidgets perfect synchronization, the most important point is that its message mechanism and MFC is quite similar to the previous experience in MFC can be slightly changed to apply to the WxPython above. In WIN32 development, the most annoying part of the wm_size message must be the place, in the main window size changes, keep the control layout in WIN32 is a hassle. This is a very good thing WX solves, and its Sizer concept makes it easy for me to maintain the perfect control layout with different window sizes. In addition, if you already hate the MFC Doc-view model, WX can also give you a new choice; If you like the Doc-view model very much, rest assured that it is still easy to achieve in WX, and the old ideas can still be used here.

WxPython has two packages, one pythoncard, and the other is Dabo. The former is a limited package of WxPython, which does not support all the features of WxPython, and its goal is to make WxPython more pythonic. The latter is much larger than Pythoncard, and it should be a three-tier framework for C/S mode development. If you want to develop database based applications (such as MIS, ERP, etc.) using Dabo is a good choice; In addition, if you have been accustomed to VB, VFP, Delphi and other RAD development environment, Dabo is not much worse than these expensive tools oh.

Py2exe
According to the evil of Windows thinking, written by the application if you do not compile an. exe file I am afraid it is not "software", Py2exe role is to put your. py script into an. exe file, which usually packs the script into a. zip file, but you can also modify the SETUP.P Y script all the scripts, dependent DLLs, and so on all packaged into an EXE, looks like VC, VB compiled the program is no different.

If your client needs to use your application under Windows, Py2exe is an indispensable tool for you. I use it to pack the small tools written by WxPython for the game planning in the company.

Psyco
The efficiency of the script is somewhat unsatisfactory, although it is not difficult to optimize, but if there is a simple method, near the need to modify the source code, it is certainly worth paying attention to. The magic of Psyco is that it only needs to invoke just two lines of code at the entrance of the code, and the performance can be increased by 40% or more, which is really immediate.

If your client thinks your program is a bit slow, please don't rush to optimize the code, Psyco may be able to change his view immediately. Psyco can be called Python JIT, there are many potential to dig, if the remaining to give you optimized performance time is not much, please go to read its manual, there are many easy to optimize performance.

PiL
PIL is the Python image processing Library, my view is strong enough to say, simple enough to say. It can open dozens of kinds of image formats, common jpg/png/bmp and so on, of course, but also provide many image processing functions, such as image enhancement, filtering algorithms, and so on, please refer to my previous article "Using Python image Processing" (http://blog.csdn.net /lanphaday/archive/2007/10/28/1852726.aspx) and "Computational Image similarity" (http://blog.csdn.net/lanphaday/archive/2008/04/24/ 2325027.aspx).

MySQLdb
This is Python's support for open source database Mysql, the official website in Http://sourceforge.net/projects/mysql-python. Support for the full range of Mysql 3.23-5.1 version, the Python version of the requirements are 2.3-2.5. MYSQLDB is the implementation of the Python DB API-2.0 and is now mature. The latest version is 1.2.2.

If you are engaged in server development, that indispensable with the database connection pool, then you can use Dbutils or jonpy two open source libraries. Where Dbutils is a set of database connection pool, while JONPY includes CGI and database connection pool and other functions, please select the appropriate library after reading the manual.

Pyprocessing
The GIL (Global interpreter Lock) in the Python interpreter makes Python a bit awkward in the multi-core era-the scripting language that supports native threads cannot use multiple CPU cores concurrently to compute through multithreading. Instead of trying to get rid of GIL, pyprocessing the sword-walk slant, trying to help Python out of the woods in a multiple-process way. The result is that using pyprocessing to create processes and interprocess communication is not only as simple as using a built-in threading module, but even simpler. Pyprocessing not only communicates with native sockets and pipes, but is perfectly packaged, its queue implementation is no different from a built-in queue, but it is a shared queue between processes.

Pyprocessing has been used as a built-in module in py2.6 and py3.0, as well as the development Community's affirmation of the Pyprocessing project. If you use Python to develop server applications, especially online gaming applications, how can pyprocessing not pay attention?

Related Article

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.