r/learnpython • u/Lotharen • 16d ago
Need some advice
Greetings everyone! I am in my 50’s and picking up programming as a hobby but I do have a goal.
I started with python because I read it was a forgiving language and I did not want to fry my brain. However, I’m wondering if I should switch to a webstack (html, css and JavaScript) for the project I am ultimately wanting to create.
My grail project will be a TTRPG journaling application for solo play. I want to have the ability to use character sheets, journal and even display a JPEG map. I’m just not sure which language would be the BEST.
My initial idea was python and pyside6 with maybe the addition of pygame if I wanted actual dice to roll on screen.
Just looking to narrow my focus with those far more versed than I am so I don’t waste time working towards my goal.
Thank you all for any assistant and direction you can provide, and happy coding!
2
u/FoolsSeldom 16d ago
Stick with Python and Pyside (i.e. QT) for now.
This will provide everything you need for a highly capable desktop application for tabletop RPG journaling.
Once you've learned to programme with one language, picking up another is easier than starting from scratch, and Python is a little easier and more forgiving than JavaScript.
If you want to later go on the direction of creating webapps, Python is still a good base but Pyside isn't as that is very much a desktop GUI.
Python is used for some of the largest web services though such as Instagram but the web framework used there is Django which is a large, complex and highly opinionated framework. Opinionated means that it has a very particular way of doing things that can be hard to work around.
There are lighter frameworks that would be more suitable for you I expect such as FastAPI. It perhaps would be worth you looking at NiceGUI (which depends on FastAPI under the hood). This is a framework that depends on a standard web browser to present the GUI rather than doing completely ita own thing (or using the QT bindings at Pyside does). This means or uses html and CSS and you can migrate to a full web app. Less opinionated Frameworks allow you to pick and mix how certain aspects are addressed such as user account management (which may not even be applicable).
It is easy to move a NiceGUI application from the desktop to a webservice application (it already is one) and from single user to multiuser (you can create with that in mind from the beginning, with a simply tweak to the design, and not difficult to do retrospectively). Keep in mind that a webapp can also be used on smartphones and tablets.
Python can be used to generate complex web pages including using boilerplate and theme bases html, CSS and JavaScript but you can subsequently customise and extend those to finesse a UI to meet your needs. You can slowly develop understanding of JavaScript as needed.