dyspatch-0.0.1
توضیحات
A simple events handler package.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | dyspatch-0.0.1 |
| نام | dyspatch |
| نسخه کتابخانه | 0.0.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | NerdGuyAhmad |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | https://github.com/nerdguyahmad/dyspatch |
| آدرس اینترنتی | https://pypi.org/project/dyspatch/ |
| مجوز | MIT |
# Dyspatch
A simple package that implements basic events handling in Python.
## Installation
```
pip install dyspatch
```
## Usage
A basic example is as follows:
```py
import dyspatch
users = []
def on_room_join(user):
print(f'{user} joined the room.')
users.append(user)
print(f'We now have {len(users)} users')
events = dyspatch.Events()
events.add_listener('room_join', on_room_join)
events.dispatch('room_join', args=['Alex'])
events.dispatch('room_join', args=['Bob'])
```
The output is like this:
```
Alex joined the room.
We now have 1 users
Bob joined the room.
We now have 2 users
```
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8.0 | Python |
نحوه نصب
نصب پکیج whl dyspatch-0.0.1:
pip install dyspatch-0.0.1.whl
نصب پکیج tar.gz dyspatch-0.0.1:
pip install dyspatch-0.0.1.tar.gz