Python Tips and Hints #1 - Dunder functions __main__ and __name__
In this first Python hints video we will talk about the difference between building a program using def main() and one using code like:
if __name__=="__main__"
We will go through a couple of code examples and show you to reference material for further reading. The links are below.
Lexical analysis
https://docs.python.org/3/reference/lexical_analysis.html?highlight=dunder
Special considerations for __main__
https://docs.python.org/3/reference/import.html?highlight=__main__
Dunder in classes
https://docs.python.org/3/library/dataclasses.html?highlight=dunder
Top level code discussion and use: __name__ and __main__
https://docs.python.org/3/library/__main__.html?highlight=__main__
And since the channel is mostly about networking ... books and other products for networkers
Packet Guide to Core Network Protocols: https://www.oreilly.com/library/view/packet-guide-to/9781449308094/
Packet Guide to Routing and Switching: https://www.oreilly.com/library/view/packet-guide-to/9781449311315/
Packet Guide to Voice over IP: https://www.oreilly.com/library/view/packet-guide-to/9781449339661/
Network Engineering Fundamentals: https://www.oreilly.com/videos/network-engineering-fundamentals/9781491932643/
Advanced Network Engineering: https://www.oreilly.com/videos/advanced-network-engineering/9781491952559/
Virtualization, Networking, and Storage: https://www.oreilly.com/videos/virtualization-networking-and/9781491970478/
-
LIVE
Talk Nerdy 2 Us
1 hour agoUnraveling Today's Cybersecurity Maze
571 watching -
34:36
The Nima Yamini Show
2 hours agoRelationships, Testosterone, and the Quest for Power: A Candid Talk
141 -
26:13
Squaring The Circle w/ Randall Carlson
7 hours ago#006 The Real Climate Crisis No One Is Talking About and Mount Tambora Pt 1
3.08K8 -
1:18:29
Kim Iversen
5 hours agoThe FIRST Lawsuit Against AstraZeneca Has Now Been Filed. Others May Be On The Way...
13.7K57 -
32:13
Alexis Wilkins
8 hours agoBetween the Headlines with ALEXIS WILKINS: Africa, Ukraine Dictator, Biden Judges, Felon Cohen, more
6.01K3 -
1:21:37
Roseanne Barr
3 hours agoKevin Sorbo saves America | The Roseanne Barr Podcast #49
28.8K128 -
4:16:54
TheGetCanceledPodcast
5 hours agoThe GCP Ep 6 | Ryan Bensen Tells Us How UHNI's Stay Rich After Divorce, New Book Release & More
7.48K -
2:10:48
Total Horse Channel
1 day ago2024 CMSA National Championship | Friday Night | 8:00 pm EST
7.86K -
1:38:43
2 MIKES LIVE
5 hours ago#70 2ML Open Mike Friday!
15.2K3 -
1:29:24
PudgeTV
4 hours agoRocket League from the Content Creator House | Party Time w Pudge
24.2K7