Never see `if __name__ == "__main__"` again!
Project description
The @entry
decorator
Tired of the traditional python if __name__ == '__main__':
pattern? Try @entry
instead!
@entry
is designed to be a simple decorator for declaring main functions in python. In the backend, the same module name check is performed, but it keeps your code a little cleaner.
Usage
Simple example:
from atentry import entry
@entry
def main():
print("Hello, world!")
Using a return value:
from atentry import entry
@entry
def main() -> int:
print("Hello, world!")
return 128 # Program exit code
Installation
Loading this library in your project is as simple as:
# Using Poetry
poetry add atentry
# Using PiP
python3 -m pip install atentry
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
atentry-1.0.0.tar.gz
(14.4 kB
view hashes)
Built Distribution
atentry-1.0.0-py3-none-any.whl
(14.5 kB
view hashes)