A simple way to link strings to functions
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
string-routing-0.0.1.tar.gz
(2.0 kB
view hashes)
Built Distribution
Close
Hashes for string_routing-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9ad266902a2e16ba53a9304f5987d19b3c84e8ef7f8a6639b16d4c67b00d107 |
|
MD5 | 074adff4704f8c48427c4d8e967f0fa9 |
|
BLAKE2b-256 | 69ee33898242981963c41b68f2daad704d28393805814e45dcbb092c57b778ab |