[cse491] Index Error
C. Titus Brown
ctb at msu.edu
Sun Sep 21 19:22:18 PDT 2008
On Sun, Sep 21, 2008 at 10:21:08PM -0400, Brett Thomas Mcmillen wrote:
-> I keep getting this error and I can't figure out how to get rid of it. I've
-> tried running python on both cmd line and idle but I can't handle any of my
-> problems because of this damn error
->
-> sock.bind(('', int(sys.argv[1])))
-> IndexError: list index out of range
->
-> Any help would be sweet :P
Hi, Brett,
try breaking the line down:
port = sys.argv[1]
port = int(port)
bind_tuple = ('', port)
sock.bind(bind_tuple)
and then see at what line you get the error message.
--titus
--
C. Titus Brown, ctb at msu.edu
More information about the cse491-fall-2008
mailing list