python - How is http://shell.appspot.com/ executing code online? -
I am creating a website that allows you to write or write python code online. Can someone provide me some help so that I can get it?
The first file you can browse them is only 321 lines!
Actually, each user has a different global dictionary for the session, then uses and Edit: Google App Do not use the engine will make things even more complicated. But you can put a look at compile and
exec to run the code and The results will return.
# # # # # # # # Log in. ('Compilation and evaluation: \ n% s'% statement) compiled = except compilation (statement, '& lt; string & gt;', 'single'): self.response.out.write (traceback.format_exc () ) Back
# runs! Old_globals = dict (statement_module .__ dict__) Try: old_stdout = sys.stdout old_stderr = sys.stderr Try: sys.stdout = self.response.out sys.stderr = self.response.out compiled_model_de_dll in exec statement : Sys Stdout = old_stdout except sys.stderr = old_stderr: self.response.out.write (traceback.format_exc ())
Comments
Post a Comment