python locals() and loop
<p>I'm trying to do something very simple, I don't know why I can't solve this...</p>

<p>I have 2 arguments, I just want to put them both into a list by using a loop, the reason I'm using a loop is because one day the function may take many sys.argv instead of locals, here's what I mean:</p>

<pre><code>def function(arg1, arg2):
    list = []
    for i in range(len(locals())):
        list.append(locals()[i])
function(1,2)
</code></pre>

<p>If you understand what I mean, can you please show me a solution to this problem? Thanks</p>
