Skip to content

Commit

Permalink
Added state and city generator
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel3dartist committed Dec 2, 2023
1 parent 506e329 commit 3dd2b07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Binary file modified .coverage
Binary file not shown.
5 changes: 4 additions & 1 deletion pyFBIG/BR_states/states.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ def rand_state(self) -> dict:

def rand_city(self, state_acronym: str = 'MG'):
_file = open(path+f"/{state_acronym}/cities.json", "r", encoding="UTF-8")
_cities: list = json.load(_file)['cities']
j = json.load(_file)
print('Json -> ', j)
_cities: list = j['cities']
print('Cities: ', _cities)
return _cities[(randrange(0, len(_cities)))]

0 comments on commit 3dd2b07

Please sign in to comment.