Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #96557

Re: How to set the history commands visible ?

Path csiph.com!news.mixmin.net!feeder1.xsusenet.com!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Return-Path <lac@openend.se>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'startup': 0.05; 'sys': 0.05; 'url:bitbucket': 0.05; 'versions,': 0.05; 'pypy': 0.07; 'cc:addr:python-list': 0.09; 'scripts': 0.09; 'subject:How': 0.09; '__future__': 0.09; 'cursor': 0.09; 'editor.': 0.09; 'received:openend.se': 0.09; 'received:theraft.openend.se': 0.09; 'subject:set': 0.09; 'tab': 0.09; 'url:github': 0.09; 'url:pypy': 0.09; 'will,': 0.09; 'wrong,': 0.09; 'python': 0.10; 'output': 0.13; 'suggest': 0.15; 'interpreter': 0.15; "'>'": 0.16; 'cc:addr:lac': 0.16; 'cc:addr:openend.se': 0.16; 'cc:name:laura creighton': 0.16; 'from:addr:lac': 0.16; 'from:addr:openend.se': 0.16; 'from:name:laura creighton': 0.16; 'gmail.': 0.16; 'happily': 0.16; 'message-id:@fido.openend.se': 0.16; 'received:fido': 0.16; 'received:fido.openend.se': 0.16; 'tab,': 0.16; 'url:py': 0.16; 'later': 0.16; 'laura': 0.18; 'stick': 0.18; 'hack': 0.18; 'input': 0.18; '>>>': 0.20; 'settings': 0.20; 'people,': 0.20; '2015': 0.20; 'cc:addr:python.org': 0.20; 'cc:2**2': 0.20; 'fix': 0.21; 'so.': 0.22; 'ones.': 0.22; 'sep': 0.22; 'tkinter': 0.22; 'decide': 0.23; 'this:': 0.23; 'import': 0.24; 'plain': 0.24; 'thus': 0.24; 'feature': 0.24; 'sort': 0.25; 'script': 0.25; "doesn't": 0.26; '(which': 0.26; 'subject: ?': 0.27; '+0200,': 0.27; 'quoting': 0.29; 'received:se': 0.29; 'spaces': 0.29; 'cc:no real name:2**1': 0.29; 'reset': 0.29; "i'm": 0.30; 'print': 0.30; 'maybe': 0.33; 'problem': 0.33; 'editor': 0.34; 'file': 0.34; 'text': 0.35; 'activate': 0.35; 'requiring': 0.35; 'something': 0.35; 'but': 0.36; 'should': 0.36; 'needed': 0.36; 'url:org': 0.36; 'lines': 0.36; 'subject:: ': 0.37; 'charset:us-ascii': 0.37; 'anything': 0.38; 'google': 0.39; 'why': 0.39; 'whatever': 0.39; 'does': 0.39; 'subject:the': 0.39; 'still': 0.40; 'some': 0.40; 'your': 0.60; 'header:Message-Id:1': 0.61; 'here.': 0.62; 'trusted': 0.64; 'respect': 0.65; 'decided': 0.66; 'user,': 0.67; 'reply': 0.68; '>how': 0.84; '>if': 0.84; 'header:In-reply-to:1': 0.84; 'idiots': 0.84; 'subject:commands': 0.84; 'subject:history': 0.84; 'this...': 0.84; 'url:master': 0.84; '"one': 0.91
To Glus Xof <gtglus@gmail.com>
cc Laura Creighton <lac@openend.se>, python-list@python.org, lac@openend.se
From Laura Creighton <lac@openend.se>
Subject Re: How to set the history commands visible ?
In-reply-to <CAGFvGiPGkD0-5JbjPrxhyZ_ff_tmppDPxSpzGGeJgpQMKgEsGg@mail.gmail.com>
References <CAGFvGiMenX=AEsmEFw4+X-W2E5rgWGrK8Fgi-xgFT4SNFjZK4Q@mail.gmail.com> <201509132015.t8DKFqLG024138@fido.openend.se> <CAGFvGiPGkD0-5JbjPrxhyZ_ff_tmppDPxSpzGGeJgpQMKgEsGg@mail.gmail.com>
Comments In-reply-to Glus Xof <gtglus@gmail.com> message dated "Sun, 13 Sep 2015 23:35:01 +0200."
MIME-Version 1.0
Content-Type text/plain; charset="us-ascii"
Content-ID <27039.1442217682.1@fido>
Date Mon, 14 Sep 2015 10:01:22 +0200
X-Greylist Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (theraft.openend.se [82.96.5.2]); Mon, 14 Sep 2015 10:01:24 +0200 (CEST)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.521.1442217695.8327.python-list@python.org> (permalink)
Lines 79
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1442217695 news.xs4all.nl 23862 [2001:888:2000:d::a6]:36295
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:96557

Show key headers only | View raw


In a message of Sun, 13 Sep 2015 23:35:01 +0200, Glus Xof writes:
>If I'm not wrong, in a later interpreter versions, when an enter key was
>pressed after writing something requiring some indentated statement(s)...
>like in:
>
>>>> for i in range (0,3):
>
>the system used to suggest "one tab" placing the cursor automatically after.
>
>I don't know why this feature doesn't remain yet... or maybe I don't know
>how activate this...
>
>Glus

I think you must have had some sort of custom startup script here.
Maybe even this one:
https://github.com/brandoninvergo/python-startup/blob/master/python-startup.py

though I found it annoying as anything as it only does the tab indent
after you have started typing.

If you decide to hack on custom startup scripts you may be interested in
https://bitbucket.org/pypy/pyrepl

PyPy needed to make a pure python replacement for readline, and did so.
It has some nice support for multi-line editing and a lot of emacs
style keybindings.  I like it.

Also, if you paste output from the interpreter into mail to other
people, you should edit your python startup file to reset sys.PS1 to
not be '>>>' right at the margin.  (mine is ' >>>').  The arrogant
idiots at Google have decided that people who ask for plain text mail
(which you currently cannot do using gmail on android) in no way
should be trusted to know what they are doing.  Thus any text that
begins with some number of '>' can be reflowed, at will, by gmail.

Since you are a gmail user, you should be able to see this:

>>> import sys
>>> import os
>>> import tkinter
>>> from __future__ import print_function
>>> for i in range(3):
...     print (i)
...
0
1
2

Now try to reply to me, quoting this in gmail.  Gmail will happily reflow
the lines above.


But it will respect these ones.

 >>> import sys
 >>> import os
 >>> import tkinter
 >>> from __future__ import print_function
 >>> for i in range(3):
...     print (i)
...
0
1
2

sys.PS1 is what is giving me ' >>>' and sys.PS2 is ...

If you want sys.PS2 to be a tab, then you can do this as well, but
note that it does not stick a tab into your input buffer for you,
so you will still need to type one -- or whatever number of spaces
you use as an indent.

If I have misunderstood, and your problem is that your editor
no longer suggests tabs, then you have lost your python-mode
settings for that editor.  But we need to know what editor that
is, before we can tell you how to fix it.

Laura

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: How to set the history commands visible ? Laura Creighton <lac@openend.se> - 2015-09-14 10:01 +0200

csiph-web