Converting string int-tuple to float-tuple
Don't think you need to do that

Firstly this will convert simple tuples of ints and floats from string

&gt;&gt;&gt; x = str((1, 20, 2.0))
&gt;&gt;&gt; 
&gt;&gt;&gt; y = tuple(float(s) for s in x.strip("()").split(","))
&gt;&gt;&gt; print(y)
(1.0, 20.0, 2.0)


However if this is in relation to previous question, its not so much a matter of (needlessly) converting ints to floats its converting a flat list (1, 2, 3, 4) into a nested list  ((1, 2), (3, 4))  2x2 for brevity sake  

Even if it is a flat list of floats it will throw the error because it wants the members of constraint_matrix to be sequences not a float or int.

So without bothering to convert to floats, and having converted string to list (or tuple)

&gt;&gt;&gt; x = (1, 2, 3, 4, 5, 6, 7, 8, 9)
&gt;&gt;&gt; tuple(zip(*(x[i::3] for i in range(3))))
((1, 2, 3), (4, 5, 6), (7, 8, 9))


For other methods.

https://stackoverflow.com/questions/312443/how-do-you-split-a-list-into-evenly-sized-chunks

This is possibly better asked on stackoverflow. Consider using re or argument parsing libraries.

Btw code in question will fail with numbers > 9