What is the difference between Python vs Jython vs IronPython vs wxPython?

Jython and IronPython are different python implementations, both of which run on different virtual machines. Jython runs on the JVM (Java virtual machine) and IronPython runs on the CLR (common language runtime). This means that programs using these implementations can take advantage of the libraries and ecosystem of the virtual machines. For example, using Jython, …

Read more

Using a java library from python

Sorry to ressurect the thread, but there was no accepted answer… You could also use Py4J. There is an example on the frontpage and lots of documentation, but essentially, you just call Java methods from your python code as if they were python methods: >>> from py4j.java_gateway import JavaGateway >>> gateway = JavaGateway() # connect …

Read more

How can I install various Python libraries in Jython?

Some Python modules, like lxml, have required components in C. These won’t work in Jython. Most Python packages will work fine, and you can install them using the same tools as you use in CPython. This is described in Appendix A of Jython Book: To get setuptools, download ez_setup.py from http://peak.telecommunity.com/dist/ez_setup.py. Then, go to the …

Read more

Distributing my Python scripts as JAR files with Jython?

The best current techniques for distributing your Python files in a jar are detailed in this article on Jython’s wiki: http://wiki.python.org/jython/JythonFaq/DistributingJythonScripts For your case, I think you would want to take the jython.jar file that you get when you install Jython and zip the Jython Lib directory into it, then zip your .py files in, …

Read more

Cross-platform way to get PIDs by process name in python

You can use psutil (https://github.com/giampaolo/psutil), which works on Windows and UNIX: import psutil PROCNAME = “python.exe” for proc in psutil.process_iter(): if proc.name() == PROCNAME: print(proc) On my machine it prints: <psutil.Process(pid=3881, name=”python.exe”) at 140192133873040> EDIT 2017-04-27 – here’s a more advanced utility function which checks the name against processes’ name(), cmdline() and exe(): import os …

Read more