[Tutor] RandomArray and numeric

Luke Paireepinart rabidpoobear at gmail.com
Tue Dec 26 08:19:20 CET 2006


Sorry, everyone, I accidentally replied to a few e-mails off-list because
I'm using the Gmail web interface, and I forgot that reply-all is not
default (I normally use thunderbird.  Yay Google for giving POP3 access to
mail.  Boo Yahoo for charging for it.)

---------- Forwarded message ----------
From: Luke Paireepinart <rabidpoobear at gmail.com>
Date: Dec 26, 2006 12:52 AM
Subject: Re: [Tutor] RandomArray and numeric
To: "linda. s" <samrobertsmith at gmail.com>



On 12/25/06, linda.s <samrobertsmith at gmail.com> wrote:
>
> Since RandomArray is with Numeric,
> why I saw a code has something like:
> from Numeric import *
> from RandomArray import *


Just because a package contains different functions does not mean they're
added as sub-modules or sub-packages or wahtever the correct term is.
For example, in the Python Imaging Library,
you do
import Image
import ImageGrab
etc.
not
import PIL.Image.

Think of packages like a directory structure.

lib
-site-packages
--Image
--ImageGrab
etc.

whereas Pygame would be

lib
-site-packages
--pygame
---display
---joystick
---draw
etc.

I'm pretty sure this is how it works.

packages are just a directory tree with a collection of .py scripts (plus a
special __init__.py in each directory, I believe.)


HTH,
-Luke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20061226/e4a6c57b/attachment.htm 


More information about the Tutor mailing list