Re: Have existing python script file that I want to execute from within a cherrypy web site/page. How can this be done 100% native to cherrypy?

[email protected] Sat, 28 Apr 2018 20:12:39 -0700 (PDT)
Newsgroups gmane.comp.python.cherrypy
Message-ID <[email protected]>
Yeah, I got a variant of it working.  Not sure it is pretty, but works.  We 
have a lot of existing python scripts we want to continue to use from 
console (Linux).  We just wanted to wrapper these with some simple web 
pages, to make them a bit easier to use.  So, I just imported the os 
module, can execute the script.  This is all internal stuff, nothing that 
has to be production hardened or such.  This lets the guys writing the 
python scripts for console do their thing, and lets me provide another 
avenue for execution.

I plan to swing back around on this one, and do more work, but using os 
module for now works.  I did notice one odd thing, a couple of our python 
classes/functions that work great from console, break when I import them to 
a CherryPy script, and then execute as you note.  One error is that bit 
shifting with the '<<' operator gripes about how it is used.  Only get that 
error, when the given function/routine is imported to CherryPy 
environment.  From console (python 2), no error at all.


On Saturday, April 28, 2018 at 1:04:56 PM UTC-7, [email protected] wrote:
>
> Have existing python script file that I want to execute from within a 
> cherrypy web site/page.  How can this be done 100% native to cherrypy?  
> Many examples reference java or CGI mods, that is not acceptable nor should 
> it be IMHO.  There has to be a 100% cherrypi method to do this, no?
>

-- 
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To post to this group, send email to cherrypy-users-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.