|
|
|
|
|
by roveo
1641 days ago
|
|
What's up with if __name__ == "__main__": some random code
at the end of module files? Never seen that, why is it used? I understand that it's a guard that only runs when the module is executed directly, but what is the code put there? For developers to quickly visually test stuff by running the module?Here, for example https://github.com/willmcgugan/rich/blob/master/rich/color.p... |
|
You can run some examples using the -m flag + the submodule:
https://rich.readthedocs.io/en/stable/live.html https://rich.readthedocs.io/en/stable/markdown.html