On my pc i got it to work with
Code: Select all
import re
msg = "rgb(124,95,8)"
r,g,b = re.findall('\d+',msg)
Any Suggestionen?
Code: Select all
import re
msg = "rgb(124,95,8)"
r,g,b = re.findall('\d+',msg)
For example byNote that r,g,b are still strings, so if you need int you'll have to convert them first.
Code: Select all
r, g, b = [int(x) for x in msg[4:-1].split(",")]