Skip to content

Commit f3c0d4c

Browse files
committed
Use driver code for the main method of a script
1 parent 1c415d4 commit f3c0d4c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

leetcode.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ def set_show_status(self) -> None:
217217
self.set_by_index()
218218

219219

220-
root = Tk()
221-
Leetcode(root)
222-
root.mainloop()
220+
if __name__ == "__main__":
221+
root = Tk()
222+
Leetcode(root)
223+
root.mainloop()

0 commit comments

Comments
 (0)