Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use Python serverside with shared hosting?

I've been told by my hosting company that Python is installed on their servers. How would I go about using it to output a simple HTML page? This is just as a learning exercise at the moment, but one day I'd like to use Python in the same way as I currently use PHP.

like image 550
Skilldrick Avatar asked Jun 13 '26 17:06

Skilldrick


1 Answers

When I used shared hosting I found that if I renamed the file to .py and prefixed it with a shebang line then it would be executed as Python.

#!/usr/bin/python

Was probably pretty bad practice, but it did work. Don't expect to be able to spit out any extensive web apps with it though.

like image 80
Fiona Burrows Avatar answered Jun 15 '26 23:06

Fiona Burrows



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!