Newbie Python question about sys.argv
<p>I'm currently going through a few tutorials to get myself up and running on Python, but I seem to hit the same problem a few times. The tutorial I'm currently following is Aloha.py in <a href="http://heather.cs.ucdavis.edu/~matloff/156/PLN/SimIntro.pdf" rel="nofollow">Introduction to Simulation</a> by Norm Matloff.</p>

<p>The problem I'm hitting seems to be in the following code:</p>

<pre><code>import random, sys
class node: # one object of this class models one network node
# some class variables
    s = int(sys.argv[1]) # number of nodes
</code></pre>

<p>The error message when I try and run the programme is:</p>

<pre><code>Traceback (most recent call last):
  File "C:\Python26\Aloha.py", line 8, in &lt;module&gt;
    class node:
  File "C:\Python26\Aloha.py", line 10, in node
    s = int(sys.argv[0])
ValueError: invalid literal for int() with base 10: 'C:\\Python26\\Aloha.py'
</code></pre>

<p>I've worked out that <code>sys.argv[1]</code> doesn't exist when I try and run the program, so does anyone know where I might be going wrong? Is there some way of starting the program that will set these values or is my system somehow set up incorrectly? </p>
