source command for python scripts (was Re: Python pretty-printers and non-ASCII strings do not play well together :-()

Thiago Jung Bauermann bauerman@br.ibm.com
Wed Nov 5 18:13:00 GMT 2008


El mié, 05-11-2008 a las 10:05 -0800, Paul Pluzhnikov escribió:
> On Wed, Nov 5, 2008 at 9:56 AM, Thiago Jung Bauermann
> <bauerman@br.ibm.com> wrote:
> > El mar, 04-11-2008 a las 11:28 -0800, Paul Pluzhnikov escribió:
> >>   (gdb) python execfile('simple.py')
> >
> > I was wondering if it would be useful to have a command in GDB to source
> > Python scripts, something like "source -p foo.py".
> 
> To tell the truth, I've just been using 'source foo.py', where the
> first line of 'foo.py' is
> 
>   python
> 
> I think it might be nice for "plain" 'source' to auto-deduce that
> this is python source either by looking at ".py" extension, or
> by scanning file contents for "obvious" python-ness.

I liked the idea of looking at the extension. Also, another argument
which I thought in favor of using a gdb command directly instead of
python execfile is that it gives you tab completion.
-- 
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center



More information about the Archer mailing list