partition string in python and get value of last segment after colon
result = mystring.rpartition(':')[2]
If you string does not have any :
, the result will contain the original string.
An alternative that is supposed to be a little bit slower is:
result = mystring.split(':')[-1]
Use this:
"client:user:username:type:1234567".split(":")[-1]
foo = "client:user:username:type:1234567"
last = foo.split(':')[-1]