添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Want to improve this question? Update the question so it focuses on one problem only by editing this post .

Closed 7 years ago .

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?

Found a useful tool to achive the conversion of java code to python - codeusingjava.com/tools/java2py Batman Rises Dec 21, 2022 at 10:12

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.

is it possible to invoke Java inside python ? my mean I use the Java code by I run it under python ? nik Jul 5, 2016 at 12:37 @nik It looks like there are some tools out there that do automatic translation of java to python code like java2python . But (currently) no automatic tool will easily produce good, maintainable, idiomatic code. What exactly is your usecase? syntonym Jul 5, 2016 at 12:41 I get your point, so probably the best is to just write the code myself from the begining and not try to translate it because it is very time consuming and sometimes very complicated. however, I liked your answer and I accept it bro. THANKS nik Jul 5, 2016 at 12:45 because it is long time i did not use Java which even I don't know how to run that code :-p nik Jul 5, 2016 at 12:46