In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "what are the standard libraries of the Python language". In the daily operation, I believe that many people have doubts about the standard libraries of the Python language. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "what are the standard libraries of the Python language?" Next, please follow the editor to study!
SQLObject
SQLObject can be thought of as the Hibernate of the Python domain. It is also the most mature and convenient Omax R mapping tool in the python community. Compared with Hibernate, SQLObject makes use of the unique characteristics of dynamic language, through flexible use of inheritance, flexible use of MetaData? Ability to quickly and easily define mapping classes directly in the program, without having to define a separate XML file as in Hibernate. Similarly, with its powerful dynamic capabilities, SQLObject has a function far less than that of Hibernate, that is, the mapping class of SQLObject can dynamically change its structure at run time, which means that the table structure in the database can also be changed at run time. In short, developers who have a little knowledge of Hibernate can quickly understand SQLObject. Although I have always thought that SQLObject is far from being able to bring the dynamic capabilities of Python to *. But this is a good start. Maybe we can see more and more innovative Oscarp R mapping tools in the near future.
TurboGear?
Since RoR (Ruby on Rails) became famous overnight in the field of Web development, trendy works have sprung up in other language communities. Although TurboGear? It's not a deliberate imitation of RoR, but it does get more attention through the RoR trend. Same as RoR, TurboGear? Is also a lightweight Web development kit, through several command-line tools can quickly generate the database as the core of the basic framework code. Typical RoR thought! This is the same as the principle of many open source frameworks-"avoid reinventing the wheel". TurboGear? The Web control layer uses the CherryPy?; persistence layer, uses SQLObject; templates, uses Kid;AJAX, and uses MochiKit?. Almost all important functional components come from third parties. TurboGear? It is more like an adhesive, combining all the functions and being able to multiply its strength.
4Suite
Although the Python standard library provides XML processing tools, it only provides some basic functions. If you want to get more powerful XML processing power, 4Suite is a better choice.
4Suite is called the "expert choice" in the XML tool. In addition to the most basic Dom-Like and SAX-Like processing libraries, 4Suite also provides XInclude,XPointer,XLink,XPath,XUpdate for XML document query, update operations, and so on; provides complete XSLT processing capabilities.
4Suite is not only powerful, but also has quite good performance. This is mainly due to the fact that the core code is completed in C. In places where you need to deal with a large number of XML documents, 4Suite is really a choice.
Pyro
The full name of Pyro is Python Remote Objects. You can literally understand the function of Pyro: to provide remote objects. Pyro provides an exceptionally concise RPC solution for the Python language. In fact, there are some more general remote calling schemes in the Python language, such as XMLRPC and SOAP, which are based on XML. So what are the advantages of a simple Python remote invocation scheme like Pyro? That's performance and ease of use.
Because of the powerful reflective power of dynamic languages, object serialization is easy for Python. The serialization of objects is called pickle in Python, which is the core mechanism of many Python applications. Pyro also makes full use of the power of pickle to provide remote object calls between networks. Its performance is much better than encoding / decoding remote objects using XML. At the same time, it is also very concise in the design of interface calls. It takes only 2 or 3 lines of code to encapsulate and invoke the object on the server side and the client side, which is much simpler and easier than SOAP.
Twisted
Last month, Zope 3.2 was released, and an important change in this version is that the network framework code that has been used for nearly a decade to handle Web requests has been abandoned and replaced by code implemented with Twisted as the core. It is said that this can improve system performance and scalability. So the Twisted library has once again become the focus of attention. The core concept of Twisted is non-blocking asynchronous network server (so it is also called ACE in Python, if you don't know what ACE is, then take a look at the previous article about C++ library), this is the network processing model of performance so far. Perhaps due to the inherent complexity of non-blocking asynchronous processing, Twisted is almost the most complex and difficult Python library I have ever seen. Users of Twisted are somewhat similar to ACE in that they are faced with a large number of new concepts and patterns. The steep learning curve hinders many people from mastering the Twisted library. This may be the necessary price to pay for high performance. No wonder O'REYLLI quoted a Hydra on the cover of his book on Twisted, which is apt.
Psyco
You can say a lot of nice things about Python, so what are its disadvantages? You don't have to ask, of course it's performance. Performance-has become a deep-rooted problem in Python. Not to mention that compared to languages like C++/Java/C#, Python still has the worst performance compared to its cousins, scripting languages such as Ruby, Perl, and PHP. The designers of Python seem to care only about the language mechanism, with little regard for performance. The CPythony engine has been developed for so many years, and looking at its source code, there is very little performance optimization code. The object reference model still uses reference counters. As for developing a JIT engine, forget it. Don't count on it. Fortunately, the emergence of Psyco brings us a glimmer of hope. Psyco greatly improves the performance of the entire application by compiling running bytecode into binary code, even by an order of magnitude in some environments. Although Psyco cannot be seen as the engine of a true JIT, it cannot provide completely transparent services like JIT in Java. But we still need to be excited about the development of Psyco. Currently, in its * * version, only two lines of code need to be added to make your program make full use of Psyco, thus improving performance.
WxPython
In the eyes of many people, dynamic languages / scripting languages are generally only suitable for doing command-line or WEB work, but they are really ugly in desktop development. There is no doubt that the emergence of wxPython is a powerful response to this prejudice.
WxPython is actually the Python encapsulation of the C++ framework wxWindow (now renamed wxWidgets) that has been developed for many years. The goal of wxWindow is to build a cross-platform GUI framework. WxWindow now works well on Windows/Unix/Mac. Natural wxPython can also span these platforms.
The native window used by wxPython. This means that there is no difference in interface appearance between GUI developed with wxPython and native GUI operating system. If you compare it with the GUI library in Java, you can see that wxPython is more like SWT than Swing. Because SWT is also a native window, think about how beautiful the interface of Eclipse is to see the advantages of native windows.
Although many C++ enthusiasts complain about the design of the wxWindow framework, after being encapsulated by Python, without pointers and event mechanisms in the MFC era, the ease of use of the wx framework has been greatly improved. This is another great charm of Python.
At this point, the study of "what are the standard libraries of the Python language" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.