New hobby, any way to host this python file?

Hey there! I’m new to coding. I whipped up a simple, silly little thing in Python and I’m curious if there’s a way to host the python code on Glitch.

https://Necron-Tomb-Dynasty-Generator.type37.repl.run

Is there any way for me to properly host this on Glitch or some other website? I’m sorry for what seems like a pretty obvious question!

You can host python on glitch. See https://glitch.com/edit/#!/flask-hello-world for a example.

3 Likes

Hi @Type37 and welcome to the glitch forum!

Each project has pip/pip3 and python/python3 installed, just make a file in the editor like test.py with this:

print("hi")

Then go to the terminal and type:

python3 test.py

This will run your file. Use pip3 to install modules like flask:

pip3 install flask

Hope this helped!

3 Likes

If your file outputs something, a web server with a cgi handler works. Basically whatever you print goes to the browser. So printing html shows html in the users browser. this info might be incorrect because the book i have with python web server was released when python 3.1 was indev

Thanks. I’m messing around with Flask now. I appreciate the help.

2 Likes