Given the following string:
my_string = "fan_num=2,fan1=0,fan2=0,chain_xtime8={X0=8,X1=3,X2=11},chain_offside_6=0,chain_offside_7=0,chain_offside_8=0,chain_opencore_6=0,chain_opencore_7=0,chain_opencore_8=0"
How can I split it such that I get the following output:
[
fan_num=2,
fan1=0,
fan2=0,
chain_xtime8={X0=8,X1=3,X2=11},
chain_offside_6=0,
chain_offside_7=0,
chain_offside_8=0,
chain_opencore_6=0,
chain_opencore_7=0,
chain_opencore_8=0
]
I've tried:
output = my_string.split(',')
However, that splits the chain_xtime8
value which is not what I want. I am using Python 2.7.