What's the use of if __name__ == '__main__': in Python? (dev.to) 2 points by quickthrower2 6y ago ↗ HN
[–] thwythwy 6y ago ↗ Does not run the entirety of the script UNLESS it's the main program.So if you're using the script as part of something else, it isn't main. It won't run. It'll instead be run through another script that references it.
1 comment
[ 2.3 ms ] story [ 13.1 ms ] threadSo if you're using the script as part of something else, it isn't main. It won't run. It'll instead be run through another script that references it.