Skip to content

Commit 7d78e69

Browse files
committed
add other resources
1 parent e8e1e94 commit 7d78e69

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

pydis_site/apps/content/resources/guides/python-guides/if-name-main.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,10 @@ Even if you don't intend your file to be used in two different ways, the convent
5858
## Why not have a `main` keyword?
5959

6060
Python often uses so-called "dunder" names for special behavior. The global name `__name__` lets files know how they are being run: directly or imported. Other languages might have a special name for the main function. Python instead lets you write your own if statement using `__name__` to decide what code should run be as the main body.
61+
62+
63+
## Other resources
64+
65+
- The Python docs have a section on [Idiomatic usage of `__main__`](https://docs.python.org/3/library/__main__.html#idiomatic-usage).
66+
67+
- Real Python has a [longer tutorial on `__main__`](https://realpython.com/if-name-main-python/).

0 commit comments

Comments
 (0)