Re: [Tutor] my own error code when no argument is sent

2008-06-17 Thread Alan Gauld
<[EMAIL PROTECTED]> wrote infile = sys.argv[1] IndexError: list index out of range is there a way that i could suppress this and add my own error code Hi Bryan, You are probably better off pursuing Danny's suggestion. But, this is what you asked for: IDLE 1.1.4 class CustomError(Excepti

Re: [Tutor] my own error code when no argument is sent

2008-06-17 Thread broek
when i execute my program without an argument i receive, infile = sys.argv[1] IndexError: list index out of range is there a way that i could suppress this and add my own error code Hi Bryan, You are probably better off pursuing Danny's suggestion. But, this is what you asked for:

Re: [Tutor] my own error code when no argument is sent

2008-06-16 Thread Danny Yoo
when i execute my program without an argument i receive, > > > infile = sys.argv[1] > > IndexError: list index out of range > > is there a way that i could suppress this and add my own error code The direct way to handle this is to check the length of sys.argv first. sys.argv is a list, so you

[Tutor] my own error code when no argument is sent

2008-06-16 Thread Bryan Fodness
when i execute my program without an argument i receive, infile = sys.argv[1] IndexError: list index out of range is there a way that i could suppress this and add my own error code ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman