Re: [Tutor] How to exit program without sys.exit()

2008-12-18 Thread bob gailer
David wrote: Hi, I make these silly programs to learn from examples I find on the list. I put a couple together just to practice. I have heard it is not a good idea to use sys.exit() but I can not figure out how to do it. Also any and all comments are welcome. Thanks Others have made valuabl

Re: [Tutor] How to exit program without sys.exit()

2008-12-17 Thread wesley chun
> I was practicing how to use a global counter and trying to understand > how functions can interact with each other. I can understand if I can > see the error's when I run the program. I know my terminology may be > hard to follow. Also I like your book :) you are well read since you already hav

Re: [Tutor] How to exit program without sys.exit()

2008-12-17 Thread David
one other suggestion... you have a lot of functions. it's possible to reduce the total number, esp. since they're pretty much all one-offs. generally, you want to employ functions for code that is used more than once during a single execution of your code. with your app, you can probably get away

Re: [Tutor] How to exit program without sys.exit()

2008-12-17 Thread Alan Gauld
"David" wrote put a couple together just to practice. I have heard it is not a good idea to use sys.exit() sys.exit is there to exit from a program so there is absolutely nothing wrong with using it. However the way you are using it is not optimal. A program will terminate or exit by itself

Re: [Tutor] How to exit program without sys.exit()

2008-12-17 Thread wesley chun
> I make these silly programs to learn from examples I find on the list. I put > a couple together just to practice. I have heard it is not a good idea to > use sys.exit() but I can not figure out how to do it. Also any and all > comments are welcome. Thanks david, welcome to Python! it's defin

[Tutor] How to exit program without sys.exit()

2008-12-17 Thread David
Hi, I make these silly programs to learn from examples I find on the list. I put a couple together just to practice. I have heard it is not a good idea to use sys.exit() but I can not figure out how to do it. Also any and all comments are welcome. Thanks #!/usr/bin/python import sys _count =