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 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   

and

  # 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 ())   

Edit: Google App Do not use the engine will make things even more complicated. But you can put a look at

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

memcached - Django cache performance -

java : convert string value to int -