Some say it’s good practice to use it in all your scripts...
Why __name__ == '__main__' is NOT as IMPORTANT as you've been told.
With __name__ == "__main__" you can check if code runs at top-level and some say it’s good practice to use it in all your scripts. But is that true? In this video, you learn why you see this code in Python so you can better decide when to use
Written by Loek van den Ouweland on 2023-03-08.
Questions regarding this artice? You can send them to the address below.