atentry-1.0.0
توضیحات
Never see `if __name__ == "__main__"` again!
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | atentry-1.0.0 |
| نام | atentry |
| نسخه کتابخانه | 1.0.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Evan Pratten |
| ایمیل نویسنده | ewpratten@gmail.com |
| آدرس صفحه اصلی | https://github.com/Ewpratten/atentry |
| آدرس اینترنتی | https://pypi.org/project/atentry/ |
| مجوز | GPLv3 |
# The `@entry` decorator
[](https://pypi.org/project/atentry/)

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:**
```python
from atentry import entry
@entry
def main():
print("Hello, world!")
```
**Using a return value:**
```python
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:
```sh
# Using Poetry
poetry add atentry
# Using PiP
python3 -m pip install atentry
```
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7,<4.0 | Python |
نحوه نصب
نصب پکیج whl atentry-1.0.0:
pip install atentry-1.0.0.whl
نصب پکیج tar.gz atentry-1.0.0:
pip install atentry-1.0.0.tar.gz