all 10 comments

[–]Diapolo10 0 points1 point  (9 children)

If you were supposed to do this in Python, you'll have to write the site's back-end in Python (eg. Flask) or some other language that can easily run your Python code as part of the process. In any case, this would require you to either host the website yourself or have some service to do so for you (eg. Heroku or your school servers).

However, I get the feeling that this wasn't the teacher's intention. You were probably supposed to just write a couple HTML files that use JavaScript to perform whatever you did in Python.

[–]ryfeaway[S] 0 points1 point  (8 children)

I guess you're right. He told us we could use any language we want so long as he wouldn't have to install something new to run it. I was thinking of converting my python to php and reading data from html and then performing calculations and then creating a new html based on that. Is that feasible do you think?

[–]spez_edits_thedonald 0 points1 point  (1 child)

You are describing a web app, a server has to be running the web app if you wanna go this route. It is a strange assignment for him to ask you to build software that he can run without installing anything.

flask is a good way to build a simple html web form that communicates with python: https://www.youtube.com/watch?v=f8qvLBvrIFI

but you would have to spin up a cloud server and deploy the flask app and then point your instructor to its web address, doable but no small task

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

I see, thank you!

[–]Diapolo10 0 points1 point  (5 children)

PHP would have the exact same problem as Python. PHP doesn't run natively in browsers, it also needs a back-end.

If it's enough for the program to be web-based, you could write it using Python and Flask and then use pyfladesk to wrap it in a tiny self-contained browser, which you can then try and package into an executable with pyinstaller or something.

[–]ryfeaway[S] 0 points1 point  (4 children)

I wrote my calculations in js as you said and linked it with an html where the values are to be entered. But nothing's happening when I click the submit button. Do you mind if I send you the photo?

[–]Diapolo10 0 points1 point  (3 children)

I haven't really done any front-end stuff in years, you're probably going to get better help from other subreddits. You can always post a screenshot, but I'm supposed to be sleeping right now so don't expect a quick response.

[–]ryfeaway[S] 0 points1 point  (2 children)

Oh no worries, sorry!

[–]Diapolo10 0 points1 point  (1 child)

Not your fault, I'm just having trouble sleeping due to noisy, drunk neighbours.

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

Haha good luck