Module clarification

Floris Bruynooghe floris.bruynooghe at gmail.com
Mon Jul 28 07:55:21 EDT 2008


On Jul 28, 9:54 am, Hussein B <hubaghd... at gmail.com> wrote:
> Hi.
> I'm a Java guy and I'm playing around Python these days...
> In Java, we organize our classes into packages and then jarring the
> packages into JAR files.
> What are modules in Python?

An importable or runable (i.e. script) collection of classes,
functions, variables etc...

> What is the equivalent of modules in Java?

Don't know.  Not even sure if it exists, but my Java is old and never
been great.

> Please correct me if I'm wrong:
> I saved my Python code under the file   Wow.py
> Wow.py is now a module and I can use it in other Python code:
> import Wow

Indeed, you can now access things defined in Wow as Wow.foo


Regards
Floris




More information about the Python-list mailing list