I would be greatfull if you could tell me how one can translate a code from Java to python.
Should one do it manually ? is there any tool to convert it automatically?
Converting code from Java to Python is made possible, however, by a utility that will automatically convert much of Java to Python. By using this application, you can save massive amounts of time using the Java wheel in a Python program.
Yes, it is possible to translate programming languages. You can convert the source code from one language into a code in a different language. Interpreting a programming language, however, is unnecessary and not possible at present.
Compilers convert one programming language into another. Usually, compilers are used to convert code so the machine can understand it. If we want it to be human-readable, we need a subset of compilers called transpilers. Transpilers also convert code however the output is generally understandable by a human.
If you want to translate java code to python you have to translate it manually. Automatic conversion generally does not have the appropriate quality. It looks like there are some tools out e.g. java2python but the author states
The generated Python code is not guaranteed to run, nor is guaranteed to be syntactically valid Python.
Converting a library to another programming language is never an easy task.
If you simply want to use a java library in a application that you want to write in python you could give jython a try.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With