moest-np / center-randomize

Script is to assign exam centers to students
MIT License
753 stars 360 forks source link

refactor: use `if __name__ == "__main__"` #65

Open karunpoudel opened 6 months ago

karunpoudel commented 6 months ago

Just a best practice. It allows to execute code when the file runs as a script, but not when it’s imported as a module (eg. call from another python script)

Created module variable random = Random() instead of overriding the module.

ref: https://realpython.com/if-name-main-python/

Note: hide whitespace changes to view the actual lines modified in the PR