Python source code compilation skills

Source: Internet
Author: User

In fact, the syntax of the Python language is very similar to that of the C ++ language, and the errors caused by some changes are very serious. This article will conduct a detailed analysis and introduction of the Python source code headaches for most users, I believe you can get the information you want after reading this article.

PyDev will display a hyperlink, so that you can navigate between the source code of the import library or function. Note that to use this feature across modules in your own source code to link from one module to another), you must modify the PYTHONPATH environment variable and add these modules to it, in this way, PyDev can find them.

The Python debugger was recently added to the PyDev plug-in. To use the debugger, click on the left of the code line to be interrupted in the Python editor to set the breakpoint. I set a breakpoint at row 1830 of feedparser. py. In the Navigator view, right-click the Python module and choose "Python> Debug ...". A STARTUP configuration window similar to the preceding one is displayed. Click Debug to enter the Debug view and start the debugger.

Python will automatically compile the module as needed. This means that Python developers generally do not have to explicitly edit modules. Even so. Sometimes it is very useful to compile Python code manually. At the same time, there are many other aspects in the construction and deployment process that can be automatically implemented. This is also the application of building tools.

I will focus on Apache Ant from the Java programming world. This tool can be widely used in Python development. Apache Ant is a de facto standard building tool in the Java programming field. It is lighter, better integrated with Java technology, and can be used to replace other building tools. Ant can run on any platform that supports the Java programming language.

Although most of the building features Ant we need have been provided, if we want to use Ant as a Python build tool, we still need some key Python-related features. I have developed several customized Ant plug-ins called task in Ant's line), which can provide the Python source code-specific features required for building Python.

Ant uses XML as the description format. Build files are organized as the targets to be executed. Each target may depend on other goals. Ant will execute any desired target based on the target you requested and a set of dependency targets. Each target may contain any number of Ant tasks, and the Ant task actually executes the work of the target.

Ant has many built-in tasks, such as compiling Java code, generating documents, manipulating files and directories. At the same time, third parties provide many additional tasks.

Now you should be able to create and run Ant build scripts that contain Python source code tasks.

  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?

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.