"linda.s" <[EMAIL PROTECTED]> wrote

>I read an example code, with something like:
> from a.b import *
> I checked and found a is a folder name and b is python code in that
> folder. I typed the above code in the IDLE and no error was 
> reported.
> Why a.b works?

This is Python "package" notation.
You can make a folder of python modules into a package
by adding a file called __init__.py. The details are described
here:

http://docs.python.org/tut/node8.html#SECTION008400000000000000000

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to