7
Storing static strings?
(lemmy.sdf.org)
Welcome to the Python community on the programming.dev Lemmy instance!
Past
November 2023
October 2023
July 2023
August 2023
September 2023
If you don't care too much about how it looks then you could just straight up have a Python dictionary in a separate file then just import it into main code.
If you want something more formal looking (or expect rather dumb users) then perhaps something like tkinter that draws default values from a file such as the above. Tkinter can enforce input types and such quite easily too.
I'm not familiar with tkinter. This is an amazing suggestion. If not for this particular use case, I very well may use it for a completely different one I still need a solve for. Thanks!
@wesker @lasagna customtkinter for visually better interface.
Note that by messing with a particular module's
__path__
you can turn it into a "package" that loads from arbitrary directories.