Scope question

phil hunt philh at comuno.freeserve.co.uk
Thu Feb 7 18:45:43 EST 2002


On Thu, 7 Feb 2002 10:26:02 -0500, MDK <mdk at mdk.com> wrote:
>I have this:
>
># myprog.py
>
>from mymod import *
>
>def dosomething(x):
>    dosomething(1000)
>
># End code
>
>I want the dosomething(1000) run from the function in mymod.  However,
>instead it is running dosomething(x) in myprog.py.

Do:

# myprog.py
import mymod
def dosomething(x):
   mymod.dosomething(1000)

>import mymod

Thisi s the prefered way of doing things.



-- 
===== Philip Hunt ===== philh at comuno.freeserve.co.uk =====
Herbivore, a zero-effort email encryption system. Details at:
<http://www.vision25.demon.co.uk/oss/herbivore/intro.html>






More information about the Python-list mailing list