Switch and Case tool
Project description
SwitchTools - Library for switch-case on python
Using Switch And Case
from switchtools.Switch import Switch,Case
Switch("Value",[
Case("CaseValue",lambda:print("test"))
])
Using Switch And Case with lambda args
from switchtools.Switch import Switch,Case
Switch("Value",[
Case("CaseValue",lambda x:print(f"test {x}"),[10])
])
Using Switch And Case with default
from switchtools.Switch import Switch,Case
Switch("Value",[
Case("CaseValue",lambda x:print(f"test {x}"),[10]),
Case("default",lambda:print(f"default"))
])
And Switch And Case can working with class
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
switchtools-1.3.tar.gz
(1.9 kB
view hashes)
Built Distribution
Close
Hashes for switchtools-1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8f7596f683d6af4d16056e554b20d2f4a9824c76558ed2bbb97f22f7e4ff31c |
|
MD5 | 80dd8227d78de8efbfea2e9861fc8e55 |
|
BLAKE2b-256 | 10c6d34dfa42f8b885ca3557e0f5d2b87499812a516aab628c7394e36cd3b7bf |