[Tutor] creation of a module

Cedric BRINER work at infomaniak.ch
Fri May 13 09:58:18 CEST 2005


hi,

1)
I'm trying to create my _first_ own module. I've decided to write each class into a separate file.

/MyModule|-bunch.py
         |-a.py
         |-b.py
         `-c.py

{a,b,c}.py contains respecetively classA,classB,classC more some unittest
and bunch.py will contains some usefull function using the class{A,B,C}

I'd like that when I import MyModule (`import MyModule')OB
 I'll see from it:
MyModule.classA
        .classB
        .classC
	.<function1 in numch.py>
        .<function2 in numch.py>
        ...
without seeing MyModule.{a,b,c}



2) does someone now how to do this:
x=3
with a function like:
assign('x',3)

-- 

Cedric BRINER


More information about the Tutor mailing list