From aee575848bfa72f5e480a6b3b73914b021fdf28e Mon Sep 17 00:00:00 2001 From: Jeremy Saklad Date: Fri, 18 Jun 2021 15:13:03 -0500 Subject: [PATCH] Only run main() if program is run directly Checking that __name__ is "__main__" prevents main() from being run if this script is imported as a module. --- Bone Market Solver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Bone Market Solver.py b/Bone Market Solver.py index 5f6f471..2b1af92 100644 --- a/Bone Market Solver.py +++ b/Bone Market Solver.py @@ -2263,4 +2263,5 @@ def main(): print(Solve(*arguments)) -main() +if __name__ == '__main__': + main()