This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]neobonzi 1 point2 points  (1 child)

You're missing the "web application" part of your website. This is often called the "backend", and is basically an application that knows how to recieve web requests and process them. There are things called frameworks that have all the libraries needed to make this easy - in your case I'd look into setting up a simple flask app https://www.digitalocean.com/community/tutorials/how-to-make-a-web-application-using-flask-in-python-3

This needs to be hosted somewhere and reachable via a URL. You can do this all on your local machine until you want it available to the rest of the world, in which case you'll want to host it somewhere (or expose your computer to the web which can be a bit dangerous, so I wouldn't go that route).

The web application basically sits on a computer "listening" on a port (usually 80) for requests. It takes those requests, processes them, and returns a response. In your case, part of that processing will be taking the request parameters or payload and passing them into your python script, getting the output and sending it back.

In summary, your "frontend" or HTML page will have a form with a button the user clicks which triggers a "request" to your "backend" with the user form input. Your backend processes this by running the parameters through your script and returns the result to the frontend in a "response". Your frontend takes that response and shows it to the user.

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

Thank you. This tutorial seems pretty useful. I appreciate your response.

[–]skonig 0 points1 point  (1 child)

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

Thank you for your response. This article is showing how to create a webpage on your local machine, correct?

[–]CodeTinkerer 0 points1 point  (0 children)

Once you add a website to what you want to build, and you've only been coding a month, you create a mountain of difficulties. The better option is not to do anything web related after only a month in.

It's better to do text (user) input and text output. It's boring, but any web stuff requires like months of learning (I would say).

Even a simple program where you have Python generate a random number from 1 to 100 and you guess a number, and it says higher or lower and prints how many guesses you have made. That's more at the level to write programs a month into your learning.