compiler module
Raymond Hettinger
vze4rx4y at verizon.net
Tue Mar 18 01:25:50 EST 2003
> > Am working on some code that reads python source to
> > find/manipulate the "block structure" for a GUI/IDE display.
> >
> > "Block structure" almost equals indentation level, but not quite.
> > So, am using the compiler module to find the blocks (class, def, if,
> > for...?)
> >
>
> Looks like tokenizer/tabnanny will do the job.
Also take a look at the inspect module which
expertly works through the block structure
in Python source.
Raymond Hettinger
More information about the Python-list
mailing list