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
> 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
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
"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
> 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
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 =