This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Make the "python" command resemble the standard Python interpreter
- From: Doug Evans <dje at google dot com>
- To: Paul_Koning at dell dot com
- Cc: khooyp at cs dot umd dot edu, tromey at redhat dot com, gdb-patches at sourceware dot org
- Date: Mon, 6 Feb 2012 12:33:48 -0800
- Subject: Re: Make the "python" command resemble the standard Python interpreter
- References: <A6FE1BE9-CD08-41A2-A1E8-F659140DA689@cs.umd.edu> <CADPb22SxGFEsAEQ3AvNnbcjWR8QPWDWC-LYq_bnpMQ1awZ_j3A@mail.gmail.com> <09787EF419216C41A903FD14EE5506DD030F1EB39B@AUSX7MCPC103.AMER.DELL.COM> <CADPb22QfoNKJr=c897GFO-RD69Lrd0HuEV2jBjanV8ZB1mb-DQ@mail.gmail.com> <09787EF419216C41A903FD14EE5506DD030F1EB45D@AUSX7MCPC103.AMER.DELL.COM> <CADPb22SV+8UW2pAO-7zdWxzOyQt2oL+aTRV8ik7AtHQ5Z3wWhQ@mail.gmail.com> <m3y5t2t6g9.fsf@fleche.redhat.com> <D8EAF73C-5BD3-4E6D-8F33-2C5BA229923C@cs.umd.edu> <CADPb22QMDkH+1veSGaKCd6FQHqqGSgovDbG8NxROsHc4PLPa5w@mail.gmail.com> <m3d3a9c8jd.fsf@fleche.redhat.com> <CADPb22R81ctfSXvU1rodeyqxwfPhVihU4m+pOC2FhXARYwrZHw@mail.gmail.com> <E4F090B1-72AE-4891-BF56-56C46028422F@cs.umd.edu> <CADPb22RzB765fDbNLeJ392eVSfnbgS4eSw1uP3q54q4yv+kkRQ@mail.gmail.com> <CADPb22SDZypdCyLq5NncG7A-c0OsuxuzQsofYOEnAak-jGsfJQ@mail.gmail.com> <CADPb22Sz+=7qvVW_COy_tqKxaBd5CHjeuARwwHAi1-c5Ksb_QA@mail.gmail.com> <09787EF419216C41A903FD14EE5506DD0310E29D2F@AUSX7MCPC103.AMER.DELL.COM>
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