|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Calling execfile() with xxx$py.class fileI have Jython embedded in my application. I have some users
who want to not pass the raw text of a python script around to some other
users, but rather would prefer to only give them the $py.class file generated
by Jython when a py file is loaded. Essentially they want an execfile()
equivalent that can accept a $py.class file instead of a .py file. The way I have things setup I have an opportunity to
implement such functionality either in python or in my java code, so I was
wondering the best way to go about make this happen. It seems like I just need
access to the methods that load the .class file and convert them to PyCode so I
can then pass that onto Py.runCode() or something – any pointers to the
best way to start attacking this problem? Sometimes these scripts are just that, simple scripts –
not class or function definitions. -------------------------------------------- Senior Architect Chip Planning Solutions Cadence
Design Systems, Inc.
------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Jython-users mailing list Jython-users@... https://lists.sourceforge.net/lists/listinfo/jython-users |
|
|
Re: Calling execfile() with xxx$py.class fileOn Fri, Aug 28, 2009 at 2:50 PM, Joey Jarosz<joey@...> wrote:
> I have Jython embedded in my application. I have some users who want to not > pass the raw text of a python script around to some other users, but rather > would prefer to only give them the $py.class file generated by Jython when a > py file is loaded. Essentially they want an execfile() equivalent that can > accept a $py.class file instead of a .py file. I believe if you have the class object, you can call org.python.core.CodeLoader.loadCode to turn the class into a PyCode object. Once you have that PyCode, you can call org.python.core.Py.runCode to run it. Is that what you're after? Charlie ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Jython-users mailing list Jython-users@... https://lists.sourceforge.net/lists/listinfo/jython-users |
|
|
|
| Free embeddable forum powered by Nabble | Forum Help |