Skip to main content

A Python event implementation similar to the C# implementation

Project description

pyEventHook

A Python event implementation similar to the C# implementation.

Examples

Create an event and suscribe handlers.

def wake_up(name):
    print(f"Wake up, {name}!")

def eat_breakfast(name):
    print(f"{name}, remember take your breakfast.")

morning_time = Event()

morning_time += wake_up
morning_time += eat_breakfast

morning_time("Ariel")

# Output
# >> Wake up, Ariel!
# >> Ariel, remember take your breakfast.

Unsuscribe from event

def wake_up(name):
    print(f"Wake up, {name}!")

def eat_breakfast(name):
    print(f"{name}, remember take your breakfast.")

morning_time = Event()

morning_time += wake_up
morning_time += eat_breakfast

morning_time("Ariel")

morning_time -= wake_up

morning_time("Ariel")

# Output
# >> Wake up, Ariel!
# >> Ariel, remember take your breakfast.
# >> Ariel, remember take your breakfast.

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

pyEventHook-0.0.1.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyEventHook-0.0.1-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file pyEventHook-0.0.1.tar.gz.

File metadata

  • Download URL: pyEventHook-0.0.1.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.13

File hashes

Hashes for pyEventHook-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8c664ea5da281b7623c990b0628e73adfa8a42381927b387f79b1d3ec0fee288
MD5 3914d3c2b5c5e7885da3eb1d37df2cfc
BLAKE2b-256 58a78ad808f83610a8b4788eee81cdc8de56302e8b65f5f65fbf8b66d5bbb86d

See more details on using hashes here.

File details

Details for the file pyEventHook-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pyEventHook-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.13

File hashes

Hashes for pyEventHook-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b4f3d75624536eb261e56722347468ec28cad63fa5efc0c49e79415919370bbc
MD5 5cbd4bfb2488d6e4345314a0898e30ce
BLAKE2b-256 a7aeccbd5be091efc72c6c05508622bd83a2cf6d49dc7271ad24d7a0462d46ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page