Creating Python Modules
Adam T. Gautier
adam_gautier at yahoo.com
Thu Mar 25 11:57:00 EST 2004
Greetings,
I am trying to create a python module for a series of class files that
because of their size I have divided into multiple files.
class Foo --> foo.py
class Boo --> boo.py
I have created a setup.py where I have for the "py_modules=['foo',
'boo']". when I run "%>./setup.py install" it copies all *.py and *.pyc
to /usr/lib/python2.2/site-packages.
When I goto use the module I have to use:
import foo
import boo
I would like if anyone could help me to be able to:
1.) Get the *.py and *.pyc (foo and boo) generated with the install to
install to "/usr/lib/python2.2/site-packages/mymodule".
2.) When using the module be able to use just one import and get source
code like:
import mymodule
foo = Foo()
boo = Boo()
I have read the tutorial docs on this and it has brought me to where I
am now but I have about 35 files/classes. I think that I need to define
a mymodule.py file and put an __init__()? method into it I am just not
sure what to do, so any help would be appreciated.
More information about the Python-list
mailing list