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/
-
2:32:56
Jerry After Dark
15 hours agoJerry After Dark: Friend Finder
19.5K1 -
1:04:21
Game On!
7 hours agoGenesis Scottish Open 2024 Preview | Plus Money Golf
20.2K1 -
1:14:28
Man in America
16 hours ago🔴 LIVE: Leaked CCP Speech Reveals Plan to KILL 100M Americans
45.9K112 -
LIVE
Right Side Broadcasting Network
1 day agoLIVE REPLAY: President Trump Holds a Rally at Trump National in Doral, Florida - 7/9/24
3,724 watching -
1:26:23
Kim Iversen
8 hours agoDo Viruses Even Exist? This Doctor Says He Can Prove That They Don't.
74.3K380 -
1:37:47
Glenn Greenwald
9 hours agoBiden Administration Blames Russia for Age Concerns; Crackdowns on Israel's Critics Escalate in U.S.; Ukraine War Appears Permanent Ahead of NATO Summit | SYSTEM UPDATE #294
89.2K174 -
1:27:00
Laura Loomer
9 hours agoEP57: LIVE COVERAGE: Trump Rally in Miami, FL
68.3K19 -
2:29:30
WeAreChange
9 hours agoBiden WON'T Handle NUCLEAR FOOTBALL If War Breaks Out After 8 PM??
92K33 -
57:56
The StoneZONE with Roger Stone
10 hours agoWill Biden Declare A National Emergency To Cancel The 2024 Election? Pete Santilli | The StoneZONE
58.2K16 -
1:04:17
The Osbournes
22 hours ago $0.21 earnedOzzy’s Ultimate Dream Band | Fan Questions Answered
77.4K16