Pause in a loop

Gilles Lenfant glenfant at NOSPAM.bigfoot.com
Tue Jul 22 14:06:10 CEST 2003


"manuel" <manuelbastioniNOSPAM at tin.it> a écrit dans le message de news:
%W7Ta.10360$t92.299097 at news1.tin.it...
>
> I've two modules: main.py and eval.py
>
> Eval.py is imported in main.py, but I've a loop
> in eval.py that must call a function in main.py...
>
> I can't import main.py in eval.py too, because
> that would create an import loop.
>
> But I'm thinking a different solution:
> a pause in a loop to return periodically an
> output. It's possible?
>
>
> thanks,
>
>           Manuel
>
>

Send that function to the eval as parameter...

<main.py>
...
import eval

def myfunc(...)
  ...
def main():
    ...
   eval.eval(x, y, z, myfunc)
...
</main.py>

<eval.py>
...
def eval(x, y, z, afunc):
     ...
    afunc(...)
    ....
    return stuff
...
</eval.py>





More information about the Python-list mailing list