Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python code translation to JVM

Is there such a thing as a "translator" (for lack of a better word in my mind now) that translates Python code directly to JVM / Dalvik bytecode?

Would be great for writing Android applications in Python!

NOTE: I know about the scripting capabilities of the Android platform but I am looking for something that would generate a '.apk' without having to install the 'scripting' package... annoying for end-users.

like image 254
jldupont Avatar asked Jan 13 '11 18:01

jldupont


2 Answers

Yes you can go to Java bytecode using jythonc. Though I'm not sure how well that would work with the Dalvik format's subtle differences.

edit: apparently there was a jythonroid project which aims to do exactly what you want, but they abandoned it in favor of SL4A

like image 126
Daniel DiPaolo Avatar answered Oct 05 '22 13:10

Daniel DiPaolo


For running python code on a JVM, check out Jython

As far as dalvik, I'm not aware of any way to convert python to dalvik. Although there is the Android Scripting Enviornment which allows you to run several scripting languages in android.

like image 26
Falmarri Avatar answered Oct 05 '22 13:10

Falmarri