[Tutor] HOWTO exit
fleet@teachout.org
fleet@teachout.org
Mon, 23 Jul 2001 11:36:20 -0400 (EDT)
I think I'm a little confused about importing modules. If I were to do
the below, unless I needed other 'sys' functions, I'd be tempted to use
"from sys import exit" and "exit()."
I'm assuming the entire module uses more memory than just the one function
and I would think one should conserve memory. (Even if one doesn't have
to - I'm from the "waste not, want not" school.)
Is there a rule of thumb regarding this issue?
- fleet -
On Mon, 23 Jul 2001 tutor-request@python.org wrote:
> Message: 4
> From: alan.gauld@bt.com
> To: adam@netdoor.com, tutor@python.org
> Subject: RE: [Tutor] HOWTO exit
> Date: Sun, 22 Jul 2001 21:50:49 +0100
>
> > I have just started python, and want to know how to
> > `exit'.
>
> There ae several ways but the most general, but least used is:
>
> raise SystemExit
>
> usually you see:
>
> import sys
> ...
> sys.exit()
>
>
> You can find explanations of this in my online beginners tutor:
>
> http://www.crosswinds.net/~agauld/
>
> Alan G.
>
>