从浏览器运行Python应用程序 [英] Run Python application from browser

查看:162
本文介绍了从浏览器运行Python应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很开心编程,在业余时间我一直在学习python。作为对自己的挑战,我为课程项目创建了一个简单的文字冒险。这不是一个编程类,所以教授不会知道如何编译一个原始的Python脚本,更不用说在他们的Mac上有一个Python解释器。



就是说,是否可以从浏览器运行python?我想象一下我的教授或任何人可以点击的一些HTML文件启动浏览器,他们可以从那里玩我的游戏。



从我对这个主题的研究中,我学到了一些叫做Django的东西。但是,我不知道它是什么,也不知道如何实现它。再次,我对编程很新,所以如果你可以像我五点解释,那将是很棒的。



编辑:我发现这个其他的线程OP提出类似的问题,但我并不完全明白批准的答案:



执行python应用程序从浏览器

解决方案

嗯,不是真的。您的基本浏览器通常支持1种编程语言,javascript。



但是,您可以使用 pythonanywhere,这是一个托管的Python环境。



您还可以尝试 skulpt ,这是python的javacript实现,我从来没有尝试过这个。


I'm pretty new to programming and I've been learning python in my spare time. As a challenge to myself, I created a simple text adventure for a class project. This is not for a programming class, so the professor won't know how to compile a raw Python script, let alone have a Python interpreter on their Mac.

That being said, is it possible to run python from a browser? I'm imagining some HTML file that my professor, or anyone, can click that launches a browser and they can play my game from there.

I've learned about something called Django from my research on this subject. However, I have no idea what it is, nor how to implement it. Again, I'm pretty new to programming, so if you could "explain like I'm five", that would be great.

EDIT: I found this other thread where the OP asks a similar question, but I don't fully understand the approved answer:

execution python application from browser

解决方案

Well, not really. Your basic browser generally supports 1 programming language, javascript.

However, you could use pythonanywhere" which is a hosted python environment.

You could also try skulpt which is a javacript implementation of python. I have never tried this myself.

这篇关于从浏览器运行Python应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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