use .pyc files via Jython
The 'compiled' python code '.pyc' files are implementation-specific. Even CPython (the standard Python implementation) is not able to import .pyc files generated by a different version of CPython. And is not supposed to. So, I would be surprised if Jython had an ability to run .pyc files created by any of CPython version.
'.pyc' files are not the same as Java bytecode (which is designed to be portable).
Decompilation seems the only way. I think there are some .pyc decompilers available, they should be able to generate Python code that could be run by Jython.
I am working on building a web interface for a Python tool. It's being designed using J2EE (Spring).
In the process, I need to make calls to Python functions and hence I am using Jython for the same.
But for some modules I don't have the Python source files, I only have the .pyc files, and a document listing the methods of that file. I need to know how I can call these functions inside the .pyc file using jython.
I have tried to de-compile the Python files but since they have been complied with Python 2.7, I am not able find a decompiler to do the job