PyDev is an integrated Development Environment for Python which works in Eclipse. It has all the capabilities you expect with an IDE.
I had problems getting PyDev to work on IBM Developer for z/OS ( ID/z). Gerald Mitchell of IBM sent me instructions which worked perfectly – so thanks to him for them. I’ve modified them slightly.
Note / Disclaimer: PyDev is not currently officially supported by the IBM Developer for z/OS product. If you have problems, IBM will not be able to help you.
The problems I had were that PyDev installed, but did not display within Eclipse. Window-> Preferences did not show PyDev, and so could not be used.
The latest PyDev requires Java 11, but ID/z in Java is at V8. PyDev 8.2.0 from February 2021 works, see PyDev Releases.
PyDev 8.2.0 is on the PyDev GitHub for install at PyDev 8.2.0 Release · fabioz/Pydev
I installed Pydev using “Install new software”. Add site
- Name PyDev 8.2.0
- Location https://github.com/fabioz/Pydev/releases/download/pydev_8_2_0/
This displayed a check box for
- PyDev for Eclipse 8.2.0.202102211157
- PyDev for Eclipse Developer Resources 8.2.0.202102211157
- PyDev Mylyn Integration 0.6.0
I selected the first one.
I got a pop up for a Security warning for unsigned content, I said “install anyway.”
I restarted the work bench. The restart may take a while as the plugins and features are integrated.
The Window -> Preferences should have PyDev in the list.
You can check the file associations now…
- Window -> Preferences -> General -> Editors -> File Associations should have a File types: entry for *.py and the Associated Editors: section should list Python Editor as one of the options.
- Window -> Preferences -> PyDev should also be populated with preferences for Editor, Interpreters, PyUnit, and Scripting PyDev.
- If you don’t set up Python via the preferences, on the first python file interaction, you may get a message that Python interpreter is not currently configured.
You can edit Python files inside the base IDz install with some of the generic file editors already installed, though they will not have Python specific language knowledge or capabilities such as content assist or syntax highlighting
To allow .py files to be edited internally, by setting the Window -> Preferences -> General -> Editors -> File Associations. Here you can choose to change the Open associated files with: option from System Editor; if none Text Editor to Text Editor as one option.
Another option is in the File types: section press Add… and then in the dialog that comes up type *.py and then press OK. (If you get a dialog message that says a file type *.py already exists that is OK: this means PyDev registered as an editor which is fine. )
In the Associated editors: section press Add… and select the Internal editors option. I would recommend then choosing Generic Text Editor, Text Editor, System z LPEX Editor, or z Systems LPEX Editor but there are several other options that may work for you. Note that you can Add… more than one editor to a a single file type, at which point if you right click on the *.py files you will have an option of which editor to use.
The one that is used when you double click or right click -> Open is the one you set to default, which you can adjust in this section by selection of one of the editors and then pressing the Default button.
Then press Apply and Close.
Example of editing a .py file

and

Running the debugger
I was not able to use the debugger as it tries to run it on my work station, not on z/OS