Skip to content

Commit c488681

Browse files
authored
Merge branch 'main' into patch-1
2 parents a020046 + 6d1a190 commit c488681

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

bot/resources/tags/if-name-main.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,13 @@ embed:
55
---
66

77
This is a convention for code that should run if the file is the main file of your program:
8-
98
```py
109
def main():
1110
...
1211

1312
if __name__ == "__main__":
1413
main()
1514
```
15+
If the file is run directly, then the `main()` function will be run. If the file is imported, it will not run.
1616

17-
If the file is run directly, then the `main()` function will be run.
18-
If the file is imported, it will not run.
19-
20-
For more about why you would do this and how it works, see
21-
[`if __name__ == "__main__"`](https://pythondiscord.com/pages/guides/python-guides/if-name-main/).
17+
For more about why you would do this and how it works, see [`if __name__ == "__main__"`](https://pythondiscord.com/pages/guides/python-guides/if-name-main/).

0 commit comments

Comments
 (0)