String-routing
Connect strings to functions. Best usage with input commands.
Usage
import route
sr = route.StringRouter() # Construct the string router
@sr.route("login")
def login():
print("Running login...")
To run the login function with the command:
command = input("Command: ") # Input command for example
sr.trigger(command) # <- will run the command if it has a link
Command: login
Running login...
Typing:
print(sr)
Will ouput:
{'login': <function login at 0xPOINTER>}
For each of the links connected
Release files for string-routing 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| string-routing-0.0.1.tar.gz | 2.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| string_routing-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.3 kB
Release files / string-routing-0.0.1.tar.gz
| Download URL | string-routing-0.0.1.tar.gz |
|---|---|
| Size | 2.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8c4df14ecca27b59b1d0330dfce36597cfae6adae4dcc52a5f250c2531c07d1e
|
|
BLAKE2b-256 checksum How to use checksums |
471f3609e29923215a3aac7766ae176204ea3f321661c3a15de1aec55bc61239
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5
|
Release files / string_routing-0.0.1-py3-none-any.whl
| Download URL | string_routing-0.0.1-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b9ad266902a2e16ba53a9304f5987d19b3c84e8ef7f8a6639b16d4c67b00d107
|
|
BLAKE2b-256 checksum How to use checksums |
69ee33898242981963c41b68f2daad704d28393805814e45dcbb092c57b778ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5
|