desperately in need of a tool

A.T.Hofkamp hat at se-162.se.wtb.tue.nl
Mon Aug 20 08:39:45 EDT 2007


On 2007-08-19, yagyala <mbrown at phys.ksu.edu> wrote:
> Hi.
>
> one of those standards is that the comments for each routine must
> indicate every other routine that it calls. As I try to keep my

> to do this by hand. Does anyone know of a tool that could do this for
> me, or at least a tool that can tell what other routines a given
> routine calls that I could program against? (Preferably something that
> works under pydev, but I'm not going to be choosy.)

Wouldn't a regular expression be enough here?

Something like

# x.py
import re, sys

fcallpat = re.compile(r'\w+\(')

data = sys.stdin.read()
for match in fcallpat.findall(data):
    print match



$ python x.py < x.py
compile(
read(
findall(

You may want to have a wider matching criterium than \w+


Albert




More information about the Python-list mailing list