How two modules call functions defined in each other?

Tian wangtianthu at
Sun Mar 20 03:07:31 CET 2005

I am python beginner, I have a question about the interdependence of

For example, when I have two modules:
def plus(x):
  return add(x,1)
def add(x,y):
  return x+y

def plus2(x):
  return plus(x)+1

How should I write "import" in both files?
What about the global varibals? is there anything like "extern" keyword
in C?
or python has some other solutions?

More information about the Python-list mailing list