A simple definition of main
Project description
Define a Python main function in one step - no more __main__!
For any non-trivial projects, use typer and dtyper instead.
Why?
Less typing
Avoid the foolish == '__main_' and other mistakes
How to install
Use pip:
pip install def_main
Usage example
import def_main
@def_main
def main(*argv):
print('hello,', *argv)
means precisely the same as:
def main(*argv):
print('hello,', *argv)
if __name__ == '__main__':
import sys
main(sys.argv[1:])
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
def_main-0.10.0.tar.gz
(1.8 kB
view hashes)
Built Distribution
Close
Hashes for def_main-0.10.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff45737b828c1b690c02177408ff45e6894db24851ba7cb4b810e979c52aa5ed |
|
MD5 | 1dcc5bbe9de0e4f8ebf310d8b087464b |
|
BLAKE2b-256 | 0ee7e6f49519a19fa3ec88d8610339daa5b96648bb195fc1244b974b6f3fdbba |