I would write it again manually. I donβt know any automatic tools that would create a not-so-disgusting looking Python, and I ported Java code to Python myself, I found that the result was both better and original and much shorter.
You get quality because Python is more expressive (for example, an anonymous inner class of MouseAdapters, etc., goes in the direction of simple functions of the first class), and you also get the opportunity to write it a second time.
It is also much shorter: for example, 99% of getters / setters can simply be excluded due to direct access to the fields. For the remaining 1% that really do something, you can use property() .
However, as David said, if you donβt need to read or maintain the code, the automatic translator will be fine.
Kiv
source share