Embedding a Python shell in a webpage [closed]

狂风中的少年 提交于 2019-12-22 09:46:32

问题


I am working on a manuscript for introducing programming to beginners. Python is one of the two languages I cover in this book. I would like to setup up a webpage with an embedded Python shell for my readers to go and try things out. What would be the best way to go about it? I am aware of web apps like repl.it. I would personally like to set something up myself, however.


回答1:


There is a sample google appengine project that provides Python shell e.g., http://live.sympy.org uses it.

Or your JavaScript code (an Ajax shell) could communicate with a sandboxed Pypy version using something like this Twisted WebSocket server.




回答2:


The fine folks at repl.it provide a version of Python that is compiled in JavaScript using LLVM and EmScripten - it's heftier than some of your other options (and possibly buggier) but it's completely client-side and therefore not vulnerable to some of the attacks that a server-side setup might be vulnerable to.




回答3:


Have a look at the new python shell provided by Datacamp.Its great and has a nice design. Check here!




回答4:


Try This. It is a Python to javascript compiler. Never used it, but I've heard about it before. GLHF



来源:https://stackoverflow.com/questions/11813301/embedding-a-python-shell-in-a-webpage

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!