[Tutor] visualizing code structure / flow charting

Timmie timmichelsen at gmx-topmail.de
Tue Nov 6 20:23:03 CET 2007

> > Is there a tool which I can run on my code and then get a flow chart from 
it or
> > visualize its structure in another form?
> http://pycallgraph.slowchop.com/ will show the call graph
I think this is exactly what I was after. I still need to install Graphviz but 
from the homepage it seems the right one.

> epydoc 3.0 can create a variety of graphics including call graph, 
> package diagram and class diagrams:
> http://epydoc.sourceforge.net/whatsnew.html
This one is a alternative to pydoc, right?
But from what I read on the web page it only focusses on the modules and 
libraries whereas pycallgraph looks at the actual script you write.

> Stepping through code in a debugger is a good way to understand it. 
> Winpdb is a good choice:
> http://www.digitalpeers.com/pythondebugger/
I good hint. Thanks. Although I wasn't really after a debugger It looks nice.

> > Is there any solution that can be used without leaning UML?
> UML is pretty much the standard these days for representing class structure.
Yes, I know. But like epydoc does care if it in it's lastest version I do not 
need to get into the basics and can stick to deepen my python skills.
> But if you are just learning Python and you are writing the programs 
> that you are trying to understand,
I understand /my/ own programs.

> I don't know why you need these kinds 
> of tools. You shouldn't be writing code that you need a flow chart 
> generator to understand! 
I would like to employ a lot of modules and ready made libraries that are 
around in the wild and also extend and write my own modules because I am 
heading towards number crunching with scipy/numpy et. al.

Even if the basic script is well written and documented and kept short I would 
like to use the graphs to get a quick overview on what is done at what point, 
which modules are imported. This could also help to validate and improve the 
approach my script is based on. Furthermore, flow charts can be included into 
publications and discussed in presentations.

I hope my needs are now a litte understandable.

For the real debugging I will follow the hints the other posters pointed out 
anserwing my question. Thanks for your help on that.

> You can ask specific questions here, if there is a bit of code you are 
> struggling with.
I know and am thankful for this patient atmosphere here!

Kind regards,

More information about the Tutor mailing list