Re: compile, marshal, exec

"Fernando" <[email protected]>
Newsgroups gmane.comp.lang.jython.user
Message-ID <1431347632181.49161.20802@webmail4>
fyi, when I try marshal.load(f), in the jyton 2.7 prompt, I get

ValueError: bad marshal data


On 11 May 2015, Fernando <[email protected]> wrote:
> Hi,
> 
> I have a (internal) web app based on zope that uses many python scripts (essentially a function).
> 
> I am considering the porting of this application to Tomcat/Jython using pyservlet. In fact, there will be only one pyservlet which gets all requests and processes them according to type, one of this being a python script.
> 
> In Python, I could use the following code to process this scripts:
> 
> >>> f = file('dateGetYmd') # the script file, which has a namesake function
> >>> obj = compile(f.read(), '', 'exec')
> >>> marshal.dump(obj, fc)
> >>> exec obj
> >>> dateGetYmd('0') # this function call will also access local objects
> 
> Would this work in Jython? docs would say so, but is there any caveats?
> 
> and what about performance? what does compile return? (python byte codes?)
> 
> Or is there a better way to do it?
> 
> Regards,
> Fernando Martins
> 
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> <http://ad.doubleclick.net/ddm/clk/290420510;117567292;y>
> 
> _______________________________________________
> Jython-users mailing list
> [email protected]
> <https://lists.sourceforge.net/lists/listinfo/jython-users>
>

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y

_______________________________________________
Jython-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jython-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.