Re: [Tutor] Using sys.exit()

2006-11-02 Thread Alan Gauld
"Dick Moores" <[EMAIL PROTECTED]> wrote >>You can use an argument if you want to pass an error value >>back to the OS. This is good practice if your script might be >>used in a batch file or shell script > > So what should that value be? Zero means no errors and is the default value. But you can

Re: [Tutor] Using sys.exit()

2006-11-02 Thread Andreas Kostyrka
Am Mittwoch, den 01.11.2006, 22:16 -0800 schrieb Dick Moores: > At 03:56 PM 11/1/2006, Andreas Kostyrka wrote: > >Am Mittwoch, den 01.11.2006, 15:43 -0800 schrieb Dick Moores: > > > At 12:14 AM 10/31/2006, Alan Gauld wrote: > > > > > > >"Dick Moores" <[EMAIL PROTECTED]> wrote > > > > > I'd like to

Re: [Tutor] Using sys.exit()

2006-11-02 Thread Luke Paireepinart
> > Yes, I realize that. But what if I'm not doing anything after the > loop? In that case is there anything wrong with using break to end the > script? I'm getting the idea from the responses that there IS > something wrong, but I don't see what it is. Generally, something that exits with a br

Re: [Tutor] Using sys.exit()

2006-11-02 Thread Dick Moores
At 11:09 PM 11/1/2006, Luke Paireepinart wrote: >>If I can manage to use "break", all 3 exits are silent. Why is it >>wrong to use "break" to exit? >> >'break' doesn't exit. It ends a loop. >It's not wrong to use a 'break' to exit a loop. That's what it's there for. >But what if you were doing s

Re: [Tutor] Using sys.exit()

2006-11-01 Thread Luke Paireepinart
Dick Moores wrote: > At 03:56 PM 11/1/2006, Andreas Kostyrka wrote: > >> Am Mittwoch, den 01.11.2006, 15:43 -0800 schrieb Dick Moores: >> >>> At 12:14 AM 10/31/2006, Alan Gauld wrote: >>> >>> "Dick Moores" <[EMAIL PROTECTED]> wrote > I'd like to know how to use

Re: [Tutor] Using sys.exit()

2006-11-01 Thread Dick Moores
At 10:16 PM 11/1/2006, Dick Moores wrote: >BTW at the command line, "raise SystemExit(2)" produces a completely >silent exit. In Win IDE I get "SystemExit: 2". With IDLE: > >Traceback (most recent call last): >File "E:\Python25\dev\1unitConversion5a.py", line 425, in > main() >File "E

Re: [Tutor] Using sys.exit()

2006-11-01 Thread Dick Moores
At 03:56 PM 11/1/2006, Andreas Kostyrka wrote: >Am Mittwoch, den 01.11.2006, 15:43 -0800 schrieb Dick Moores: > > At 12:14 AM 10/31/2006, Alan Gauld wrote: > > > > >"Dick Moores" <[EMAIL PROTECTED]> wrote > > > > I'd like to know how to use sys.exit() to quit a program. > > > > > > > > > >I see tha

Re: [Tutor] Using sys.exit()

2006-11-01 Thread Andreas Kostyrka
Am Mittwoch, den 01.11.2006, 15:43 -0800 schrieb Dick Moores: > At 12:14 AM 10/31/2006, Alan Gauld wrote: > > >"Dick Moores" <[EMAIL PROTECTED]> wrote > > > I'd like to know how to use sys.exit() to quit a program. > > > > > > >I see that you already figured that out. > >You can also quit by raisi

Re: [Tutor] Using sys.exit()

2006-11-01 Thread Dick Moores
At 12:14 AM 10/31/2006, Alan Gauld wrote: >"Dick Moores" <[EMAIL PROTECTED]> wrote > > I'd like to know how to use sys.exit() to quit a program. > > > >I see that you already figured that out. >You can also quit by raising SystemExit, which is >what sys.exit does... but you don't need to import sy

Re: [Tutor] Using sys.exit()

2006-10-31 Thread Alan Gauld
"Dick Moores" <[EMAIL PROTECTED]> wrote > I'd like to know how to use sys.exit() to quit a program. > I see that you already figured that out. You can also quit by raising SystemExit, which is what sys.exit does... but you don't need to import sys... > Is there a way to use it the way I want to?

Re: [Tutor] Using sys.exit()

2006-10-30 Thread Chris Hengge
Try using SPE, I've really liked it for some of extra features inside it like TODO tags that are automanaged. Also, its written in python, so thats kinda  cool factor. It's also free. On 10/30/06, Dick Moores <[EMAIL PROTECTED]> wrote: At 05:06 PM 10/30/2006, Dick Moores wrote:>I'd like to know ho

Re: [Tutor] Using sys.exit()

2006-10-30 Thread Dick Moores
At 05:06 PM 10/30/2006, Dick Moores wrote: >I'd like to know how to use sys.exit() to quit a program. > >Here's a simple example: > >import sys > >c = 0 >while True: > c += 1 > if c > 1: > sys.exit() > >Now, this will certainly exit, but not without a lot of extra noise. >Is t

[Tutor] Using sys.exit()

2006-10-30 Thread Dick Moores
I'd like to know how to use sys.exit() to quit a program. Here's a simple example: import sys c = 0 while True: c += 1 if c > 1: sys.exit() Now, this will certainly exit, but not without a lot of extra noise. Is there a way to use it the way I want to? Maybe with an argum