Exploring a variety of Python languages

Source: Internet
Author: User

SQLITE is a very small embedded open source database software, that is to say, there is no independent maintenance process, all maintenance comes from the program itself. It uses a file to store the entire database, which is very convenient to operate. Its biggest advantage is its ease of use, which is indeed somewhat different from other large databases.

However, SQLITE is not inferior in terms of performance. Although the sparrow is small and dirty, sqlite implements the standard of most sql-92, such as transaction, trigger and complex query. You can use sqlite connect to create a database file. The path is specified above. When the database file does not exist, it is automatically created.

If the file already exists, open the file. Encoding indicates the encoding used to save the data. cp936 is a self-contained encoding in Python, which is actually GBK encoding. Cx is a database connection object. Thanks to the joint efforts of designers and the open-source community, there are a large number of excellent libraries in python that can be called directly to efficiently fulfill different requirements. Here are some common libraries:

Tkinter ---- default graphical interface of Python. Tkinter is a Python module with Tk interfaces. The Tkinter Library provides interfaces for Tk APIs, which belong to the GUI tool group of Tcl/Tk. Tcl/Tk is a writing and graphics device developed by John Ousterhout.

Tcl (tool command language) is a macro language used to simplify the development of complex programs in shell. Tk Toolkit is developed with Tcl to simplify the design process of user interfaces. The Tk toolkit consists of many different widgets, such as a button and a scroll bar. With these widgets provided by Tk, we can quickly develop the GUI. Perl, Scheme, and other languages also use the Tk library for GUI development. Tkinter is cross-platform and can be used on various platforms.

Python Imaging Library (PIL)-python provides powerful graphic processing capabilities and supports a wide range of graphic file formats. This Library can convert, print, and display graphic formats. It can also process some graphic effects, such as Zoom-in, zoom-out, and rotation. It is a powerful tool for Python users to perform image processing.

Pmw (Python megawidgets) Python super GUI component set-an advanced GUI component built using the Tkinter module in python. Each Pmw combines one or more Tkinter components, to achieve more useful and complex functions.

PyXML-a toolkit for parsing and processing XML documents using Python. The 4DOM in the package is fully compatible with W3C DOM specifications. Xmlproc: a compliant XML parser. Expat: a fast, non-verified XML parser.

There are other modules similar to PyHtml PySGMLPyGame for multimedia development and game software development. PyOpenGL-the module encapsulates the "OpenGL Application Programming Interface", through which python programmers can integrate 2D and 3D graphics in the program.

Python is easy to expand and embed. Many standard modules provided by Python support C or C ++ interfaces. Python and C can work together and can be embedded into C or C ++ applications. Therefore, the Python language can be used to provide a script interface for the application. Because it supports cross-language development, you can use Python to design a conceptual application and gradually port it to C. You do not have to use C to rewrite the application.

(Jython enables Python to work with Java, so that developers can call Java packages in Python or use Python objects in Java.

Even better, because the Jython interpreter is fully written in Java, you can deploy Python programs on any platform that supports Java, and even run Python scripts on WEB browsers .) In a C ++ application, we use a set of plug-ins to implement functions with unified interfaces. We use Python to replace the plug-ins in the form of dynamic link libraries.

In this way, you can easily rewrite the script code as needed, rather than re-compile the dynamic link library of the link binary. The powerful functions of Python are sufficient, but some specific functions of the operating system need to be implemented using C ++, which is then called by Python. Therefore, we need:

1. Embed Python into the C ++ application, call the Python function in the C ++ program, and obtain the value of the variable;
2. Compile the extension module (Dynamic Link Library) for Python using C ++, and call the extension function developed by C ++ In the Python program.

Python has the most abundant and powerful class libraries in the scripting language and is sufficient to support most daily applications. Its name comes from a comedy. Perhaps those who initially designed the Language Python did not expect that today Python will be widely used in industry and scientific research.

Eric Raymond, a famous free software author, listed Python as one of the four programming languages that hackers should learn in his article "How To Be a hacker, we recommend that you start learning programming from Python. This is indeed a pertinent suggestion. Python is one of the best choices for programming learners who have never learned programming or are not computer professional.

  1. Introduction to Python system files
  2. How to correctly use Python Functions
  3. Detailed introduction and analysis of Python build tools
  4. Advantages of Python in PythonAndroid
  5. How to Use the Python module to parse the configuration file?

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.