Jythonc missing

拥有回忆 提交于 2019-12-20 10:46:40

问题


I just installed Jython 2.5.1. I want to convert my Python file into Java class file and it is instructed on the website to use the jythonc command-line tool but I can't find it. Does anyone know where I could find it?

Basically what i was trying to accomplish is to get my Python code running client-side in a browser and the best way seemed to be by creating an applet using Jython. I don't want to create a desktop application and using Silverlight/IronPython is out of the question. Any other ideas are welcomed.

Cheers!


回答1:


Jythonc was removed in Jython 2.2 and is no longer supported. The official way to embed Jython code in Java is to create an instance of the interpreter to run the Jython code directly. There is an article on this here.

Personally I preferred the jythonc method and hope it will be reinstated in a future version of Jython, even though it had a number of issues.




回答2:


You can still compile your python-code to class-files:

import compileall; 
compileall.compile_dir('Lib'); # to compile yor Lib-Dir 

should work with 2.5 jython

i use it to create class-files to put in jars :-)



来源:https://stackoverflow.com/questions/2763129/jythonc-missing

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!