在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:natural/java2python开源软件地址:https://github.com/natural/java2python开源编程语言:Python 94.3%开源软件介绍:java2pythonSimple but effective tool to translate Java source code into Python. The java2python package can translate any syntactically valid Java source code file. The generated Python code is not guaranteed to run, nor is guaranteed to be syntactically valid Python. However, java2python works well many cases, and in some of those, it creates perfectly usable and workable Python code. For more information, read the introduction. To install, refer to the installation page. There are lots of docs, plenty of tests, and many options for controlling code generation. If you're looking for old releases, check the downloads link above. Here's a very simple example: $ cat HelloWorld.java // This is the HelloWorld class with a single method.
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, world.");
}
} Next we run our program: $ j2py HelloWorld.java #!/usr/bin/env python
""" generated source for module HelloWorld """
# This is the HelloWorld class with a single method.
class HelloWorld(object):
""" generated source for class HelloWorld """
@classmethod
def main(cls, args):
""" generated source for method main """
print "Hello, world."
if __name__ == '__main__':
import sys
HelloWorld.main(sys.argv) |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论