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 Introduction to Simulation by Norm Matloff.
The problem I'm hitting seems to be in the following 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
The error message when I try and run the programme is:
Traceback (most recent call last):
File "C:\Python26\Aloha.py", line 8, in <module>
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'
I've worked out that sys.argv[1] 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?