Jim wrote:

> 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()

import sys
def a():
     sys.modules['__main__'].m()
     return None

Anton

'now why would anyone want to do *that* ?'


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to