Skip to main content

Traffic Light Simulator Goals

This is an attempt to simulate a simple traffic light. You can specify how long you want each light show before it changes to the next light, as well as the number of cycles (green to red or red to green light changes) you want before the simulator stops running.

Install

Install with pip

You may want to do this in a virtualenv if you don’t want to clutter up your global packages. Certainly not necessary, but if you want to use a virtualenv just:

$ virtuanelv testenv
$ cd testenv
$ . bin/activate

Then simply install with pip:

$ pip install traffic-light-simulator

Using the source files

Simply clone this repo.

Running the simulator

If you installed with pip, you have a script available to you to run the simulator. Simply enter into your terminal:

$ traffic-light-simulator

Otherwise, if you’ve cloned the repo, just run the traffic_light_simulator/user_interface.py with your interpreter:

$ python user_interface.py

Running the tests

There are some tests that I wrote while writing the TrafficLight class, located in tests.py. If you want to run it simply run it with your interpreter

$ python tests.py

Metadata

Release files for traffic-light-simulator 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for traffic-light-simulator 0.1.2
File Size Uploaded Provenance
traffic-light-simulator-0.1.2.tar.gz 3.8 kB Without provenance Details

Release files / traffic-light-simulator-0.1.2.tar.gz

Download URL traffic-light-simulator-0.1.2.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
51cf03c36ccaeeb6dd71c8c89c2d9371c7def35114813a57d7adad65b4f47ff6
BLAKE2b-256 checksum
How to use checksums
eebaaa0cb564c6a01f173fa20d751d95a5435a27f8d97ceb4a97d689c3841eba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for traffic-light-simulator 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page