Wednesday, January 9, 2019

Karim Elghamrawy: Python: __name__ == “__main__” Explained

You see it everywhere. If you have been coding in Python for a while, or just casually browsing Python Github repositories, you probably have come across this snippet of code. if __name__ == '__main__': # do something It is ubiquitous. In fact, this is how many times this above snippet appears in Github! 18 millions+ [...]

The post Python: __name__ == “__main__” Explained appeared first on Afternerd.



from Planet Python
via read more

No comments:

Post a Comment

TestDriven.io: Working with Static and Media Files in Django

This article looks at how to work with static and media files in a Django project, locally and in production. from Planet Python via read...