2 ms·
What's the use of if __name__ == '__main__': in Python?
- thwythwy 7y agoDoes 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.