I have a string with values in the form key=value, separated by space, i.e.
my_string = "a=1 b=10 z=234 h=5"
what I need is to use a regex and store those value in a dictionary; so far I've done this:
my_dict = dict(re.findall(r'(\S+)=(".*?"|\S+)', my_string))
print(my_dict)
the problem is that print does not prints the item in the same order they appear in the string. so, due to my lack in python debugging knowledge, I don't know if is the findall() that stores values in my dictionary in a random order... or the print(). What I need is a way to store items in order, exactly as they appear in the string... maybe cycling through it. any suggestion will be appreciated, thank you very much