Skip to main content

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.2.tar.gz (1.9 kB view hashes)

Uploaded Source

Built Distribution

switchtools-1.2-py3-none-any.whl (2.1 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