Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I run a Python script on my web server? [closed]

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.

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?

like image 684
HellaMad Avatar asked Feb 22 '12 16:02

HellaMad


People also ask

How do I run a Python script from the server?

To run Python scripts with the python command, you need to open a command-line and type in the word python , or python3 if you have both versions, followed by the path to your script, just like this: $ python3 hello.py Hello World!

How do I run a Python script without closing?

cmd /k is the typical way to open any console application (not only Python) with a console window that will remain after the application closes.


1 Answers

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.

This is a great link you can start with.

Here's another good one.

Hope that helps.


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

like image 71
Carlos Avatar answered Oct 09 '22 13:10

Carlos