This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Some feedback about the python scripting feature


On Tue, Nov 10, 2009 at 08:06:05AM -0700, Tom Tromey wrote:
> Marcelo>    * *interactive python: *the current python command reads lines using
> Marcelo>      gdb normal input instead of the regular python prompt line, making
> Marcelo>      some nice features of python unavailable like
> Marcelo>      completions-proposals (pressing the tab-key to get the name of a
> Marcelo>      function completed) or auto indentation. Maybe running the regular
> Marcelo>      python prompt line can be an option.
> 
> You should be able to easily enter the Python repl, though offhand I
> don't know how.

I thought it was easy to get the actual repl... but it isn't.  There
is a C function for it, but not a Python method.

However, there's a very good simulacrum:

  py import code
  py code.InteractiveConsole().interact()

Send EOF to exit.

I don't know if it has completion or automatic indentation, because no
version of Python I have installed does either :-)  Is this new?

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]