How do I access a main frunction from an import module?

Jim jscrerar at compuserve.com
Fri Nov 24 09:12:27 EST 2006


Hi,

I have created an import module.  And would like to access a function
from the main script, e.g.,

file abc.py:
###################
def a():
    m()
    return None
####################

file main.py:
#####################
from abc import *
def m():
    print 'something'
    return None

a()
######################

python25.exe main.py

Thanks,
Jim




More information about the Python-list mailing list