Needs??? Sorry to be blunt, but this is an intrinsically ludicrous
concept, in *any* language. The whole idea of modules is (wait for
it)
modularity. A imports B which imports A is an utter nonsense.
There is such a thing called 'recursion'. Self-recursion is when
function x calls itself to
Circular import dependencies don't work well; depending
on the exact conditions they can leave you pulling your hair
out for hours. In your example, just pull the global variable
out into a third module and have both of your major
modules import and reference it from there.
In general, you should
Hi
I'm new to Python, I've read the FAQ but still can't get the following
simple example working:
# file main_mod.py:
global_string = 'abc'
def main():
import auxiliary_mod
instance = auxiliary_mod.ClassA()
instance.fun()
return
main()
# file auxiliary_mod.py:
class ClassA:
MackS wrote:
Hi
I'm new to Python, I've read the FAQ but still can't get the following
simple example working:
# file main_mod.py:
global_string = 'abc'
def main():
import auxiliary_mod
instance = auxiliary_mod.ClassA()
instance.fun()
return
main()
# file
On 19 Mar 2005 12:05:18 -0800, MackS [EMAIL PROTECTED]
wrote:
Hi
I'm new to Python, I've read the FAQ but still can't get the following
simple example working:
# file main_mod.py:
global_string = 'abc'
def main():
import auxiliary_mod
instance = auxiliary_mod.ClassA()
instance.fun()