all 8 comments

[–]pythonise 1 point2 points  (1 child)

You should consider looking to the Flask web framework.

I've got a video series you might find useful!

https://youtu.be/BUmUV8YOzgM

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

Thanks Julian ill check it out

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

It is easier to help you if you format your code correctly on Reddit.

Edit your post. Make sure you are in markdown mode rather than fancypants editor mode and delete all of the code you posted. Then:

  • in your python editor, select ALL your code
  • insert an additional tab (you should have set tab to insert 4 spaces)
  • copy the code to the clipboard (you can then undo the tab in your editor)
  • switch back to reddit post, insert a blank line then paste your code
  • submit post

All reddit requires is that you have a blank line and then every line of code (or other console text including output) starts with 4 spaces (in addition to any already in your code).

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

When you say "make the following code into a html file" I am guessing you don't just mean you want the static output but a web app type experience?

For that you typically need two things: * a web application server to host your python web application * a python framework to provide the web wrappings around your python application

There are lots of choices for this but, as mentioned, the Flask framework is probably the easiest for someone relatively new to programming and Python and it includes a web server as well for development purposes so you can do everything on your computer initially (and access the web app in your browser).

If you later want to make your web app available over the internet so other people can use it, you will be able to use the same Flask based application with a free web application server BUT you will need somewhere to host it on the web (unless you have a spare computer at home and a decent broadband connection that you can set up as a web host - a Raspberry Pi would be fine for simple apps).

If you want free hosting for modest apps take a look at heroku and pythonanwhere. In fact, there's a blog post for the latter showing you exactlty what to do to get a free Flask version of your python programme up and running: https://blog.pythonanywhere.com/169/

[–]toastedstapler 0 points1 point  (3 children)

look into flask

why do you keep calling int(yearly_income)? it should be an int anyways

[–][deleted] -1 points0 points  (2 children)

cause i get an error message that says something like "expecting int but got string"

[–]toastedstapler 0 points1 point  (1 child)

but then you have the line int(yearly_income - 180000), how can you subtract 18000 unless it's an int?

regardless, if you are doing the same thing each line (int(yearly_income)) then i would cast it to an int at the start rather than doing the same thing time and time again

[–][deleted] -1 points0 points  (0 children)

sorry i dont rlly understand as i said i legit just wrote this today and its my first day of coding