What is the best way to split a variable length string into variables in Python?
<p>Suppose I have a string of integers separated by commas of variable length. What is the best way to split the string and store the integers into variables?</p>

<p>Currently, I have the following. </p>

<pre><code>input = sys.argv[1]
mylist = [int(x) for x in input.split(',')]
if len(mylist) == 2: a, b = mylist
else: a, b, c = mylist
</code></pre>

<p>Is there a more efficient way of doing this? </p>
