在网页中嵌入Python Shell [英] Embedding a Python shell in a webpage

查看:241
本文介绍了在网页中嵌入Python Shell的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究将编程介绍给初学者的手稿。 Python是本书中介绍的两种语言之一。我想建立一个带有嵌入式Python外壳的网页,供我的读者试用。最好的方法是什么?我知道像 repl.it 这样的网络应用。但是,我个人想自己设置一些东西。

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.

推荐答案

repl.it 提供在以下版本中编译的Python版本使用LLVM和 EmScripten 的JavaScript -比其他一些选项(可能是buggier)要复杂但它完全是客户端,因此不易受到服务器端安装程序可能容易受到的某些攻击。

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.

这篇关于在网页中嵌入Python Shell的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆