This is the mail archive of the gdb-patches@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: Make the "python" command resemble the standard Python interpreter


On Mon, Feb 6, 2012 at 12:13 PM,  <Paul_Koning@dell.com> wrote:
> End of block is defined by smaller indent.

Here's a cut-n-paste of an experiment I just did.

[dje@annie ~]$ python
Python 2.7 (r27:82500, Sep 16 2010, 18:02:00)
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> if 0 == 1:
...   print "foo"
... print "bar"
  File "<stdin>", line 3
    print "bar"
        ^
SyntaxError: invalid syntax
>>>

In a script Python can see the change in indentation.
I gather in interactive mode things work differently, otherwise how
can I terminate the `if' without invoking something new.

btw, "repl" == "Read Eval Print Loop".
http://en.wikipedia.org/wiki/REPL


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