The Python interpreter supports interactive execution of Python code. This method is very useful for debugging a piece of code, because you do not need to put the code into the Python script and execute the script. At the same time, the interaction mode of the Python interpreter can be easily integrated into Eclipse.
To support Python interactive execution, Run> External Tools to add an External Tool to start the program. The External Tool Startup Program Configuration window is displayed. Select "Program" in the deployments list and click "New" to create a New configuration. Name the configuration as "pythonInteractive", set the Location to point to your Python interpreter, and then pass "-I" as a unique parameter.
Under the Common tab, select the check box to display the configuration in the External Tools favorites menu.
To Run the starter created in Eclipse, choose Run> External Tools> pythonInterpreter. The output of the Python interpreter is displayed in the Console view. You can enter and execute Python commands in the Console, just like running Python from the command line.
To import and use a module in interactive mode, you must add the module location to the PYTHONPATH environment variable. 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 manually compile the Python interpreter. 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.
- How to Create a Python language
- Advantages of Python
- In-depth analysis of the Python standard library
- Research on Python features
- Reveal the secrets of Python features
I have developed several customized Ant plug-ins called task in Ant's line), which can provide Python-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 be executed 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.