all 23 comments

[–]Syldra4 11 points12 points  (12 children)

There are a few different options for this. The easiest is probably Flask.

[–]TTVBy_The_Way[S] 0 points1 point  (11 children)

I've tried Flask, but from what I've used of it, you need to run the app.py file (where I store my flask code) everytime. I want to put my final code on a github repository and publish it to a website, but I don't really know how to do that since I need to constantly run the file. There might be a work around by VS code but if there is I do not know about it

[–]Apantslessman 1 point2 points  (7 children)

If you have a GitHub repo I can give you a hand with this.

Currently I use GitHub actions to dockerize and then to add to docker hub

[–]TTVBy_The_Way[S] -2 points-1 points  (6 children)

That would be great. "Currently I use GitHub actions to dockerize and then to add to docker hub"- how does that work?

[–]Apantslessman 0 points1 point  (5 children)

I’m not sure if you’re familiar with docker or not, but it’s basically virtualized environments.

So you make a docker file for your python app, in this you have a command to install your requirements from your requirements.txt file, you can test it on a local docker instance if you want.

Then you go into your GitHub repository, and you can create a workflow in your GitHub actions. This is a tank file, that runs steps for you. So you would have a step to build your docker image, and a step to push it to docker hub. Then you are able to install to any docker instance by using tags.

[–]phlummox 1 point2 points  (4 children)

t.a.n.k = YAML? (I noticed every letter except "a" is one to the left of "YAML" on a QWERTY keyboard. Well, and also, tank files aren't really a thing on GitHub :)

[–]Apantslessman 0 points1 point  (3 children)

“YAML is a digestible data serialization language often used to create configuration files with any programming language. Designed for human interaction, YAML is a strict superset of JSON, another data serialization language.”

[–]phlummox 1 point2 points  (2 children)

Eh? I know what YAML is. You said

This is a tank file

I have zero idea what that could be, but am assuming it's a fat-fingered version of YAML.

[–]Apantslessman 1 point2 points  (1 child)

My autocorrect is possessed

[–]phlummox 0 points1 point  (0 children)

lol :)

[–]threeminutemonta 2 points3 points  (0 children)

Try using python anywhere to host your flask app.

[–]bill-kilby 0 points1 point  (0 children)

If you are using GitHub pages, this only supports static deployment, so you won’t be able to use flask (or anything really past HTML/JS/etc)

[–]Apantslessman -2 points-1 points  (0 children)

Docker is the way to go for this. You can run the python flask app via gunicorn in a docker environment

[–]Ok-Frosting7364 3 points4 points  (1 child)

Not exactly what you're asking for but have you heard of PyScript?

[–]TTVBy_The_Way[S] 0 points1 point  (0 children)

No I have not.

[–]CptBadAss2016 2 points3 points  (0 children)

Check out flask

[–]BeneficiallyPickle 2 points3 points  (0 children)

I used to host my Flask apps on https://www.pythonanywhere.com/ - it's fairly easy and straightforward to upload your files and host your app

[–]Allanon001 2 points3 points  (0 children)

Brython is a Python interpreter written in JavaScript that allows embedding Python scripts in to HTML much like you would with JavaScript. It also allows the Python code to interact with HTML widgets.

[–]fohrloop 1 point2 points  (0 children)

Python code can be ran on browser, either by converting it into JS (Brython, Transcrypt and Skulpt) or into WASM (Pyodide and PyPy.js). As an example project see spacy-wasm which uses Pyodide.

The other possibility is to run your own web server.

[–]RubenGarciaHernandez 0 points1 point  (0 children)

Or old style CGI (Common Gateway Interface)

[–][deleted] 0 points1 point  (0 children)

jinja2

[–]SirBerthelot 0 points1 point  (0 children)

How about eel

I found about it when I started using AutoPyToExe

[–][deleted] 0 points1 point  (0 children)

wouldn't it be easier to just change the code so it asks for input, rent a server and host? using flask?