#line directive

zunbeltz zunlatex at hotmail.com
Wed Mar 12 02:58:54 EST 2003


Peter Hansen <peter at engcorp.com> wrote in message news:<3E6DEE2D.B69B7A68 at engcorp.com>...
> zunbeltz wrote:
> > 
> > Has Python a #line directive like C preprocesor?
> 
> The functionality you are looking for is probably included,
> but in a different way.  Can you describe what you want to
> do with that information?  Check whether a combination of
> sys._getframe() and the "inspect" or "traceback" modules 
> might not do the job.
> 
> -Peter
I'm writing a programe in a literate programming way using nuweb. 
Nuweb permit to mix code and comments and to arrange the code in
diferent way.  I proces the nuweb file and get a .py file.  When i run
this .py file sometimes i get error mensages ( a lot of times :-) This
mensages referes  to lines in the .py file and no in the nuweb file,
which is my "source file".  I want to be able to say the python
interpreter that the line it is reading is not that of the .py and is
line number XXXX in the nuweb file

thanks

Zunbeltz




More information about the Python-list mailing list