If you want to learn python programming you're in the right place! I like to keep Python programs simple and also general for folks who are just learning, so the concepts they learn will be applicable to most programming languages. And that's easy to do in Python, but there are also a lot of Python idioms that people will see if they start exploring. One of those is the if _name_ == "__main__" code that people put at the bottom of their Python programs. Want to know why? Let's have some fun learning about a standard Python idiom!
Here's a link to the Python _main_ documentation:
docs.python.org/3/library/__m...
This is my introductory python book, Problem Solving with Python here, as an ebook:
www.amazon.com/dp/B0B3V2DMQF
and as a textbook:
www.barnesandnoble.com/w/prob...
If you're interested in object-oriented programming or game programming with Python and pygame, here is Objects & Games with Python in ebook form:
www.amazon.com/dp/B0B3V93YG9
or as a textbook:
www.barnesandnoble.com/w/obje...
The github repository with the code examples from this video is here:
github.com/ProfessorBurke/Pyt...
Funnel image from:
upload.wikimedia.org/wikipedi...
Attribution:
DataBase Center for Life Science (DBCLS), CC BY 4.0 creativecommons.org/licenses/..., via Wikimedia Commons
Apple icon from:
upload.wikimedia.org/wikipedi...
Attribution:
Original: Rob Janoff, Public domain, via Wikimedia Commons
Негізгі бет Why do python programs have if __name__ == "__main__" at the bottom?
Пікірлер: 2