如何在我的 Web 服务器上运行 Python 脚本? [英] How do I run a Python script on my web server?

查看:35
本文介绍了如何在我的 Web 服务器上运行 Python 脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始学习 Python,现在很迷茫.我想在通过 hosts24.com 托管的服务器上运行我的脚本.他们的常见问题解答说他们支持 Python,但我不知道把我的脚本放在哪里才能运行.

I've just started learning Python, and I'm pretty lost right now. I want to run my script on my server that is hosted through hosting24.com. Their FAQ says they support Python, but I have no clue where to put my script for it to run.

在我的根目录中有一个名为 cgi-bin 的文件夹,我猜这是我放置脚本的地方?有人可以向我解释这是如何工作的吗?

There is a folder called cgi-bin in my root, I'm guessing that is where I put my script? Can someone explain to me how this works?

推荐答案

非常简单,您可以将 Python 脚本重命名为pythonscript.cgi".将其发布到您的 cgi-bin 目录中,添加适当的权限并浏览到它.

Very simply, you can rename your Python script to "pythonscript.cgi". Post that in your cgi-bin directory, add the appropriate permissions and browse to it.

这是一个很好的链接,您可以从这里开始.

这里是另一个不错的.

希望有所帮助.

EDIT (09/12/2015):第二个链接早已被删除.将其替换为提供参考原始信息的信息.

EDIT (09/12/2015): The second link has long been removed. Replaced it with one that provides information referenced from the original.

这篇关于如何在我的 Web 服务器上运行 Python 脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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