Skip to main content

A python module made to generate random event at almost random time

Project description

A python module made to make random event at almost random time based on interval and chance

Installation

pip install random-event

Quick Example

from random_event import events

possible_event_list = ["Earthquake", "Tornado", "Tsunami"]

rand_event = random_event(event_list=possible_event_list, interval=15, chance=50) 
# every 15 second, it will decide wether it will generate an event or no, if yes it will pick random item from possible_event_list list

@rand_event.event()
def on_event(event):
    print(event)

rand_event.start() # start generating random event every specified interval time

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

Random Event-0.2.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

Random_Event-0.2-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

Supported by

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