Open this example in the interactive library
Source code
key, separator, value = 'theme=dark=night'.partition('=')
print(key, separator, value)Sample output
theme = dark=night

Split once with partition. A self-contained example using the Python standard library.
Open this example in the interactive library
key, separator, value = 'theme=dark=night'.partition('=')
print(key, separator, value)theme = dark=night