How can I print all arguments passed to a python script?
<p>How can I print all arguments passed to a python script?</p>

<p>This is what I was trying:</p>

<pre><code>#!/usr/bin/python
print(sys.argv[1:]);
</code></pre>

<p><strong>update</strong></p>

<p>How can I save them to a file?</p>

<pre><code>#!/usr/bin/python
import sys
print sys.argv[1:]
file = open("/tmp/test.txt", "w")
file.write(sys.argv[1:])
</code></pre>

<p>I get</p>

<pre><code>TypeError: expected a character buffer object
</code></pre>
