tags:

views:

101

answers:

3
in python ,if 

a.py
from b import bb
bb()

b.py
from c import cc
def bb():
  do someting else
  cc()

c.py
from d import dd
def cc():
  do someting else
  dd()


d.py
from e import ee
def dd():
  do someting else
  ee()

e.py
from f import ff
def ee():
  do someting else
  ff()

to Understood bb function,i must open 5 file,i was very faint .

if there any better way to read bb function.(a tools to read source code better)

thanks

+1  A: 

The best way to import the ff function from the f module would be to use an import statement in your program:

from f import ff
ff(...)

Or you could use the form:

import f
f.ff(...)

EDIT:

If you are looking for tools to better read/navigate through the source code, I recommend creating a tags file for your source code tree (using either ctags or ptags.py).

You then point a capable editor (like Vim or Emacs) to that file, and use the editor's features to navigate your way through the code. For instance, using Vim, Ctrl-] jumps to the definition of the symbol under the cursor.

What editor are you using?

codeape
A: 

Whoever wrote the code for file a.py should have just written

a.py

from f import ff

I mean isn't that what OO and modules are supposed to do: make code reusable?

Or maybe this is an example of obfuscation by tiresomeness.

Christopher Mahan
A: 

If you're not already using an IDE, you might like to give bpython a try

James Polley