[Tutor] Importing Modules

->Terry<- tvbare at socket.net
Tue Apr 25 03:27:25 CEST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Tomorrow (Apr 25, 2006) at 8:53am, John Connors spoke these wise words:

- ->G'day,
- ->
- ->I'm having trouble understanding the difference between,
- ->
- ->import sys
- ->and
- ->from sys import *
- ->
- ->It seems to me they both do the same thing.
- ->
- ->John

import sys imports sys elements in their own namespace
  use by preceding elements with 'sys.'

from sys import * imports sys elements in the local namespace
  use elements as any other local - no 'sys.' prefix

d:^)
- -- 
    Terry     <tvbareATsocketDOTnet>
                     ',
                  .-`-,\__
                    ."`   `,
                  .'_.  ._  `;.
              __ / `      `  `.\ .--.
             /--,| 0)   0)     )`_.-,)
            |    ;.-----.__ _-');   /
             '--./         `.`/  `"`
                :   '`      |.
                | \     /  //
                 \ '---'  /'
                  `------' \
      jgs/a:f      _/       `--...

       <http://members.socket.net/~tvbare/>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFETXsAQvSnsfFzkV0RApBrAJ9gKu6tnxF8cAkmRpqfd8eFPxdEZACdGSk+
0AvUDxCmUZ+cZeHnp0VHid8=
=a8iW
-----END PGP SIGNATURE-----



More information about the Tutor mailing list