params = "foo=bar,blah=boo,etc=something" pair_list = params.split(",") for pair in pair_list: x,y = pair.split("=") ...