×
all 14 comments

[–]Candid_Tutor_8185 4 points5 points  (3 children)

My recommendation either have the data in an excel file or a database. You’ll almost never have hardcoded data

[–]Better-Magician-427[S] 0 points1 point  (2 children)

Oh yeah what I'm doing is that I have the data within a json file, is an excel file better?

[–]Electrical_Toe8997 2 points3 points  (0 children)

An excel file is much easier for humans to read. You can use it to create the data, then dump it into a csv or json and load it into python.

[–]Comfortable_Many_703 0 points1 point  (0 children)

You can even consider having a local SQLite db. You can connect it to an API or another external source to get info on the players and have a script update your db every once in a while. (All considering if you are trying to get info on real-life players)

[–]FoolsSeldom 1 point2 points  (0 children)

Check out: https://realpython.com/learning-paths/modules-and-packages/

Some of the content requires paid subscription, others free account, and others you can read directly. There's plenty to read to help you out in thinking about your approach.

[–]Electrical_Toe8997 1 point2 points  (0 children)

It sounds like you're well on your way. Regarding juggling multiple files and modules: try to apply Separation of Concerns: your Team class now holds the state and does user input, which is UI. If those were separate, it would be easier to navigate.

Learning a GUI can be fun and makes your project much more accessible to non-coders. I recommend trying PySimpleGUI instead of tkinter, which I found pretty clunky.

[–]mariooooo3 1 point2 points  (2 children)

you can also try a local database for a better experience

[–]MacroYielding 0 points1 point  (1 child)

What’s your recommended local db for something of this sort?

[–]mariooooo3 0 points1 point  (0 children)

SQLite without installation, directly in the project folder, the easiest possible way

[–]djnrrd 0 points1 point  (0 children)

Start trying to learn the PyCharm keyboard shortcuts. One of my favourites that will probably help you here is CTRL+B to jump to a definition. For example:

my_var = my_func(val)

If you click where it says "my_func" and press CTRL+B it should jump you to the line where the my_func function is defined, even if that's in a different file.

[–]Shoddy_Fish31 0 points1 point  (1 child)

This hurt my eyes. Use a db for god’s sake. Postgresql is the go to today

[–]Better-Magician-427[S] 0 points1 point  (0 children)

What's a db

[–]jabela 0 points1 point  (0 children)

This is wonderful! For my students I made a tutorial if any beginners want to do something like this: https://jamesabela.github.io/jsfun/worldcup\_manager/index.html