packages

M

Mage

Hello,

I read about modules and packages in the tutorial. I think I understand
how to use packages and modules, even I know how to create a module (as
far I understand it's a simple .py) file , but I don't know how can I
create a package and when should I do it.

Where should I look for more information?

Mage
 
F

F. Petitjean

Le Mon, 18 Apr 2005 20:29:39 +0200, Mage a écrit :
Hello,

I read about modules and packages in the tutorial. I think I understand
how to use packages and modules, even I know how to create a module (as
far I understand it's a simple .py) file , but I don't know how can I
create a package and when should I do it.
The standard library contains some packages : email, xml, distutils ...
Read the __init__.py in the directory "package-name".
Where should I look for more information?

Mage
example of use :
import distutils
help(distutils)
help(distutils.sysconfig)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
AttributeError: 'module' object has no attribute 'sysconfig'
import distutils.sysconfig
help(distutils.sysconfig)
distutils.sysconfig.get_python_lib(standard_lib=True)
'/home/fp2x/local/lib/python2.4'
distutils.sysconfig.get_python_lib(standard_lib=False)
'/home/fp2x/local/lib/python2.4/site-packages'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,234
Messages
2,571,180
Members
47,813
Latest member
RustyGary3

Latest Threads

Top