Jython Programming Tool

zhaozj2021-02-16  53

A good programming language is better than a good road, a good editor tool, like a good sports car. So far, the editing tools written specifically for the development of Jython programs are not very much, but I am convinced that as Jython is gradually accepted and used, Jython's development tools will become very rich. In fact, for editing tools, we hope that the function list entry should be available in the text editor; the syntax is highlighted; the code is folded; automatic completion; indentation detection; block increasing / cancellation; block annotation / cancel notes; interactive Jython shell. Other functions are also available for certain features: class browser, function jump list, integrated debugger, and analyzer (PROFILER). Of course, you can support graphical interface designers or "drag and drop" development, it is better.

Jython has a relatively simple writing, and the programming method of the most primitive text is already able to bring us a lot of convenience. Failed, Jython itself is a kind of python, so some Python IDE can be used directly. The main thing I will introduce a few Python programming tools: Jedit, IdleFork, and common text editor EditPlus2 and WSAD configurations to Jython macros.

3.1 Jedit

Jedit is a GPL project, which is written in Java, so you can run on many platforms; it has the binding and customization of many programming languages; it allows users to create and share macro and "plug-in" so that the editor is more powerful. No Jedit, specially customized for Python, but you don't have to take care of this because there are many bindings and plugins for Python.

Some of Jedit's excellent Python dedicated features come from Jython plugins. The complete Jython release is packaged as a plugin for Jedit. Of course, you will tend to choose the latest version of Jython itself, this article is 2.1, which is more old (relative to version 2.3 of CPYTHON recently released). However, if you can accept this Jython version, you can complete the real Python development work using Jedit. In addition to the interactive shell, you can run a Python buffer to make the output or displayed in an interactive shell or in a new buffer (may be saved later). Sandy small features such as saving interactive conferences are also very practical.

3.2Idle

Idle starts running a enhanced interactive shell window (relative to basic interactive tools, which provides better support for copying, paste, scrolling). I just want to call the command call, I am very worried, because you have to move the cursor to the row you want to repeat. I think I prefer Jedit or Python Shell's Readlines style. When most developed, you use the Python-Aware editor (not supported by code folding, but there is excellent syntax highlighting and code replenishing function). You can also have a class browser and debugger.

The iDLE's menu is TK "tear-off" style; that is, click the dotted line of any drop-down menu will make the menu have your own persistent window. If you enable the "Edit" menu to "dock" on your desktop, you will be particularly convenient. The IDLE debugger supports setting breakpoints, single-step execution, and observation variables; however, the contents of memory locations and variables cannot be obtained, and the timing and other statistics cannot be performed.

IDLE has most of the excellent features that you expect to have Python editor: Note / cancel notes; indent / cancel indentation; regular expression search; jump line; convert tab to spaces or convert space to tabulation symbol. It is not particularly carefully designed, but is committed to those that you need to use by Python. I really like it in the grammatical highlight, you can choose a bold color, although most editors can be configured, but only give a relatively soft color by default. Unfortunately, in Mac OS X, not all key value bindings can take effect - but this may be a problem supported by X11, or in my system actually TK / Aqua is not running results. Idle itself is innocent; I just use the mouse to learn more menu I don't use. Linux systems typically have better support for key value binding, but depending on the window manager you are using. 3.3 EditPlus Configuration for Jython

Editplus is the 32-bit text editing program, HTML editing and programmer's Windows platform editor of the Internet era. It can fully replace the notepad, and it also provides a number of strong features of web writers and programming designers. For HTML, CSS, PHP, ASP, Perl, C / C , Java, JavaScript, and VBScript syntax highlights. Of course, it can also expand other programming after custom syntax files. The chimeric web browser makes the preview of the HTML page, and the FTP command is uploaded to the FTP server. Other features include HTML toolbars, user tools, list numbers, rulers, and URLs. Automatic completion, scrapbook, rancher selection, powerful search and replacement, multiple revoke / redo, spell detection, custom keyboard shortcuts, and more. It is a very favorite Windows text editing tool. The embedded manner can be used in EditPlus to implement compilation of Jython.

The configuration of EditPlus embedding Jython is as follows:

1) Open EditPlus, select menu: Tools / Configure User Tools

2) Select Group1

3) Click Add Tools >> Program

4) Enter Jython in the Menu Text box

5) Select Jython-21.bat file in the Common input box.

6) Enter: $ (filename) in Argument

7) Initial Directory Enter: $ (FileDir)

As shown below:

8) Test

Establish a test file HelloWorld.py, the contents of the file are as follows:

Run the program: Tools> Jython, pop up an applet window, indicating that the run is successful

3.4 WSAD Configuration for Jython

I believe that developing EJB programmers must have heard of WSAD (IBM WebSphere Studio Application Developer), especially Java developers who develop WebSphere applications. WSAD is based on the latest Eclipse technology to help business developers quickly, easily design, build, build, test, and integrate Java TM 2 platform Enterprise Edition (J2EE) and web service applications. WSAD fully supports EJB 2.0, supports message-driven beans, EJB Query Language (EJBQL), Entity Bean Relations (CMR), Web Packages (WAR), and Enterprise Appliances (EAR) deployment; provides simple J2EE project structure; including IBM WebSphere Applications The unit test environment of Server Version 4 and Version 5 can create multiple items using different unit test configurations. Java tools and support support Java Development Pack (JDK) version 1.3, and can switch between multiple Java runtime environment (JRE); ​​support incremental compilation; provide a universal local and remote debugger; including Java source file tools To search, compare and consolidate code; provide new visual Java editors to facilitate visual programming; use the latest innovations of Eclipse technology, such as Java DOC generation, enhanced reconstruction tools, updated code assist and template support. WSAD also supports embedding external programs, similar to the Configuration in WSAD, similar to the EditPlus configuration, the specific methods are as follows: 1) Open WSAD, select menu Run / External Tools / Configuration

2) Click "New" button

3) Enter "Jython" in the name

4) Select Jython-21.bat file in the tool location

5) The tool is selected from the variables "$ {resource_name}"

6) Work Directory Select "$ {Container_LOC}"

as the picture shows:

转载请注明原文地址:https://www.9cbs.com/read-21274.html

New Post(0)