Classes and the command line

Chris Angelico rosuav at gmail.com
Tue Oct 28 00:57:10 EDT 2014


On Tue, Oct 28, 2014 at 3:08 PM, Terry Reedy <tjreedy at udel.edu> wrote:
>> It's inconsistent only because the default sys.ps2 is those dots,
>> which aren't necessary in Idle. You could make it consistent by simply
>> changing sys.ps2.
>
>
> Nope.  User code is executed in the user process.  Its only effect on the
> Idle process is to write to stdout or stderr for display.  There is  tracker
> issue about letting users change sys.ps1 *in the Idle process*, but it would
> have to be through the menu or config dialog.

I knew that, honest I did... umm, let's just pretend I was talking
about changing sys.ps2 in the console interpreter. Yeah. Because I
totally knew that changing it in Idle wouldn't work. Plus, I tested it
before posting, like everyone should. Honest!

Changing it in the console interpreter does work, though.

Python 3.5.0a0 (default:301b9a58021c, Oct  2 2014, 09:20:24)
[GCC 4.7.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.ps2="    "
>>> def x():
        pass

>>>

And if you want consistency, that's a good way to get it.

ChrisA



More information about the Python-list mailing list