<[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
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:
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
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