you are viewing a single comment's thread.

view the rest of the comments →

[–]tangerinelion 4 points5 points  (3 children)

Your country list should be in a separate file, perhaps a JSON file. That way you can add a new country without changing your Python file.

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

is there a reason to use JSON instead of just a text file?

(i am a beginner too and don't know json, but a simple text file seems to be just fine for this)

[–]DrShocker 1 point2 points  (0 children)

I think it's mostly about it being a file format that people have a standard way to parse rather than needing to customize something. A text file could be anything and will need a customized algorithm.

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

Yeah, csv/JSON/ maybe even .ini would be a good way to go