[Tutor] function vs module
Chris Kassopulo
ckasso@sprynet.com
Fri, 6 Sep 2002 15:18:21 -0400
On Fri, 06 Sep 2002 12:35:55 +0200
Magnus Lycka <magnus@thinkware.se> wrote:
>
> There are several options here.
>
> You can set a variable in the global scope of your module
> from an importing module.
>
> import ListColumns
> ListColumns.ReturnFlag = 1
> ListColumns.ListColumns(...)
Thanks for your reply. I used this option and it works
beautifully. It sheds much light on referring to modules
for me.
> You can obviously send "ReturnFlag" as a parameter to
> your function call.
I had a working version using this method at some point,
but had changed it because the global way seemed more
appropriate.
> You can use a class with a method instead of a module
> with a function. Then you just set an approriate value
> to ReturnFlag at initialization, or at any other point
> before calling the method. But if you only need one
> instance of this class, the first approach with the
> module global variable is enough.
This one is above my head for the moment.
Thanks again
Chris Kassopulo