[Python-ideas] Re: New feature to revert 'barry_as_FLUFL' future import

2021-09-18 Thread Jeremiah Vivian
If "barry_as_FLUFL" is a joke, I see no reason why there shouldn't be another joke disabling it. ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org

[Python-ideas] Re: New feature to revert 'barry_as_FLUFL' future import

2021-09-17 Thread Stephen J. Turnbull
David Mertz, Ph.D. writes: > This feature request comes about 196 days to early. +195 (from Japan ;-) ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org

[Python-ideas] Re: New feature to revert 'barry_as_FLUFL' future import

2021-09-17 Thread David Mertz, Ph.D.
This feature request comes about 196 days to early. It is perhaps worth considering on April 1, but not in September. On Fri, Sep 17, 2021 at 8:59 AM Jeremiah Vivian < nohackingofkrow...@gmail.com> wrote: > NEW_FEATURE = "remove_barry_from_BDFL" or >

[Python-ideas] Re: New feature to revert 'barry_as_FLUFL' future import

2021-09-17 Thread Steven D'Aprano
barry_as_FLUFL is a joke, not a serious feature. Why do you want to enable it, then remove it? What's your motivation for this feature? -- Steve ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to

[Python-ideas] Re: New feature

2020-10-18 Thread Eryk Sun
On 10/18/20, Mike Miller wrote: > On 2020-10-17 17:05, Eryk Sun wrote: >> CMD's CLS is implemented with three API calls: >> GetConsoleScreenBufferInfo to get the screen-buffer dimensions and >> default text attributes, ScrollConsoleScreenBufferW to shift the >> buffer out, and

[Python-ideas] Re: New feature

2020-10-18 Thread Eryk Sun
On 10/18/20, Mike Miller wrote: > > Also, a shell is not a terminal, so terminal routines don't feel right in > shutil. Putting get_terminal_size() there was a mistake imho. The shutil module "offers a number of high-level operations on files". ISTM that shutil.get_terminal_size is a high-level

[Python-ideas] Re: New feature

2020-10-18 Thread Mike Miller
On 2020-10-17 17:05, Eryk Sun wrote: CMD's CLS is implemented with three API calls: GetConsoleScreenBufferInfo to get the screen-buffer dimensions and default text attributes, ScrollConsoleScreenBufferW to shift the buffer out, and SetConsoleCursorPosition to move the cursor to (0,0). Would

[Python-ideas] Re: New feature

2020-10-18 Thread Mike Miller
On 2020-10-17 17:21, Eryk Sun wrote: On 10/16/20, Rob Cliffe via Python-ideas wrote: May I suggest it be called os.clearscreen()? I'd prefer shutil.clear_screen(). There's already shutil.get_terminal_size(). I know there's also os.get_terminal_size(), but its use isn't encouraged.

[Python-ideas] Re: New feature

2020-10-18 Thread Eryk Sun
On 10/17/20, Christopher Barker wrote: > > then how about os.clear_terminal() ? IMO, an os level function such as os.clear_terminal(fd) should only support terminal/console devices and would be implemented in Modules/posixmodule.c. Higher-level behavior and support for IDEs belongs in shutil. >

[Python-ideas] Re: New feature

2020-10-17 Thread Christopher Barker
On Sat, Oct 17, 2020 at 5:23 PM Eryk Sun wrote: > I'd prefer shutil.clear_screen(). There's already > shutil.get_terminal_size(). I know there's also > os.get_terminal_size(), but its use isn't encouraged. > then how about os.clear_terminal() ? after all, this will not clear the "screen", by

[Python-ideas] Re: New feature

2020-10-17 Thread Eryk Sun
On 10/16/20, Rob Cliffe via Python-ideas wrote: > > May I suggest it be called os.clearscreen()? I'd prefer shutil.clear_screen(). There's already shutil.get_terminal_size(). I know there's also os.get_terminal_size(), but its use isn't encouraged. ___

[Python-ideas] Re: New feature

2020-10-17 Thread Eryk Sun
On 10/13/20, Mike Miller wrote: > > The legacy Windows console has another limitation in that I don't believe it > has a single API call to clear the whole thing. One must iterate over the > whole > buffer and write spaces to each cell, or some similar craziness. No, it's not really similar

[Python-ideas] Re: New feature

2020-10-17 Thread Rob Cliffe via Python-ideas
On 16/10/2020 03:46, Guido van Rossum wrote: Let's add a function os.clear(), and perhaps IDLE (or some enterprising IDLE hacker) can monkey-patch that to do whatever makes IDLE's shell reset. May I suggest it be called os.clearscreen()?  The os module has functions related to file

[Python-ideas] Re: New feature

2020-10-17 Thread Holly Short
Not an educator, but since no-one seems to have mentioned this: I often use "os.system('clear')" for quick and dirty terminal animations, eg. to debug a maze solver for some competitive coding challenge... Not much of a use case, and doesn't really matter if it's not portable. On Tue, 13 Oct 2020

[Python-ideas] Re: New feature

2020-10-17 Thread Marco Sulla
On Sat, 17 Oct 2020 at 21:50, Ethan Furman wrote: > > On 10/17/20 10:54 AM, Marco Sulla wrote: > > > I think that in this case `clear` simply writes N enter chars, until > > the terminal is "cleared". IMHO this is the safest option. > > 'clear' should also leave the cursor in the upper-left

[Python-ideas] Re: New feature

2020-10-17 Thread Carl Smith
The IPython terminal has used Python Prompt Toolkit since version 5, so PPT would be my default choice for any shell or console applications (though I haven't used it for a few years). -- Carl Smith carl.in...@gmail.com On Sat, 17 Oct 2020 at 20:51, Ethan Furman wrote: > On 10/17/20 10:54 AM,

[Python-ideas] Re: New feature

2020-10-17 Thread Ethan Furman
On 10/17/20 10:54 AM, Marco Sulla wrote: I think that in this case `clear` simply writes N enter chars, until the terminal is "cleared". IMHO this is the safest option. 'clear' should also leave the cursor in the upper-left position, which cannot be gotten by writing a bunch of line feeds.

[Python-ideas] Re: New feature

2020-10-17 Thread Marco Sulla
On Sat, 17 Oct 2020 at 03:37, Steven D'Aprano wrote: > > On Fri, Oct 16, 2020 at 11:30:56PM +0200, Marco Sulla wrote: > > > Well, in terminals like bash, `clear` does not really delete the > > previous input. It simply move the scroll so the first line of the > > input is the current input. > >

[Python-ideas] Re: New feature

2020-10-17 Thread Eryk Sun
On 10/16/20, Steven D'Aprano wrote: > > On terminals that support it, this should work: > > - `print('\33[H\33[2J')` > > but I have no idea how to avoid clearing the scrollback buffer on > Windows, or other posix systems with unusual terminals. In Windows 10, ANSI sequences and some C1 control

[Python-ideas] Re: New feature

2020-10-16 Thread Michael Smith
On Fri, Oct 16, 2020 at 22:42 Steven D'Aprano wrote: > On Fri, Oct 16, 2020 at 10:28:20PM -0400, David Mertz wrote: > > On Fri, Oct 16, 2020, 10:16 PM Steven D'Aprano > > > > > I think that if we go ahead with this, we shouldn't allow lack > > > of support for screen and/or tmux to stand in the

[Python-ideas] Re: New feature

2020-10-16 Thread David Mertz
On Fri, Oct 16, 2020, 10:43 PM Steven D'Aprano > > What manner of savages run a terminal without a multiplexer? :-) > I understand using screen or tmux when ssh'ing into a remote machine, but > what advantage are they when you are using the local machine via a GUI? > It was definitely

[Python-ideas] Re: New feature

2020-10-16 Thread Steven D'Aprano
On Fri, Oct 16, 2020 at 10:28:20PM -0400, David Mertz wrote: > On Fri, Oct 16, 2020, 10:16 PM Steven D'Aprano > > > I think that if we go ahead with this, we shouldn't allow lack > > of support for screen and/or tmux to stand in the way. A 99% solution is > > better than a 0% solution :-) > > >

[Python-ideas] Re: New feature

2020-10-16 Thread David Mertz
On Fri, Oct 16, 2020, 10:16 PM Steven D'Aprano > I think that if we go ahead with this, we shouldn't allow lack > of support for screen and/or tmux to stand in the way. A 99% solution is > better than a 0% solution :-) > What manner of savages run a terminal without a multiplexer? :-)

[Python-ideas] Re: New feature

2020-10-16 Thread Steven D'Aprano
On Fri, Oct 16, 2020 at 09:53:35PM -0400, David Mertz wrote: > On Fri, Oct 16, 2020 at 9:36 PM Steven D'Aprano wrote: > > > > Well, in terminals like bash, `clear` does not really delete the > > > previous input. It simply move the scroll so the first line of the > > > input is the current

[Python-ideas] Re: New feature

2020-10-16 Thread David Mertz
On Fri, Oct 16, 2020 at 9:36 PM Steven D'Aprano wrote: > > Well, in terminals like bash, `clear` does not really delete the > > previous input. It simply move the scroll so the first line of the > > input is the current input. > > That's not actually correct: in bash, `clear` actually deletes

[Python-ideas] Re: New feature

2020-10-16 Thread Steven D'Aprano
On Fri, Oct 16, 2020 at 11:30:56PM +0200, Marco Sulla wrote: > Well, in terminals like bash, `clear` does not really delete the > previous input. It simply move the scroll so the first line of the > input is the current input. That's not actually correct: in bash, `clear` actually deletes the

[Python-ideas] Re: New feature

2020-10-16 Thread Steven D'Aprano
On Sat, Oct 17, 2020 at 05:44:12AM +1100, Chris Angelico wrote: > On Sat, Oct 17, 2020 at 5:40 AM Jonathan Crall wrote: > > > > I just want to point out that I can think of a valid use case for `clf`. > > I'm not sure if it was mentioned. > > > > In the case where you have a script that produces

[Python-ideas] Re: New feature

2020-10-16 Thread Marco Sulla
Well, in terminals like bash, `clear` does not really delete the previous input. It simply move the scroll so the first line of the input is the current input. Maybe the REPL can emulate this in some way. ___ Python-ideas mailing list --

[Python-ideas] Re: New feature

2020-10-16 Thread Ethan Furman
On 10/13/20 4:46 PM, Steven D'Aprano wrote: And I [clear my screen] frequently, in both Python and bash. Because I never remember the name of the bash command to do it (cls or clear?), and Python doesn't have one, I just hold down the Enter key for a couple of seconds until there's no clutter

[Python-ideas] Re: New feature

2020-10-16 Thread Jonathan Crall
@Paul Moor, I agree with you. Personally, I'd rather not use it, and if it was used in an importable module I'd claim it was bad practice. But in general I don't think there is a right answer of if you *should *or not. I think it is valid for personal preferences to vary here. If this is

[Python-ideas] Re: New feature

2020-10-16 Thread Rob Cliffe via Python-ideas
On 16/10/2020 22:02, Paul Moore wrote: On Fri, 16 Oct 2020 at 20:43, Jonathan Crall wrote: @Chris Angelico If you are more application focused, or trying to get a scientific result, and you don't care too much about the reusability of your scripts, then I can see the validity of this use

[Python-ideas] Re: New feature

2020-10-16 Thread Paul Moore
On Fri, 16 Oct 2020 at 20:43, Jonathan Crall wrote: > > @Chris Angelico If you are more application focused, or trying to get a > scientific result, and you don't care too much about the reusability of your > scripts, then I can see the validity of this use case. But I would not want > to

[Python-ideas] Re: New feature

2020-10-16 Thread Jonathan Crall
@Chris Angelico If you are more application focused, or trying to get a scientific result, and you don't care too much about the reusability of your scripts, then I can see the validity of this use case. But I would not want to install a module on pypi that made use of this. >From a software

[Python-ideas] Re: New feature

2020-10-16 Thread Chris Angelico
On Sat, Oct 17, 2020 at 5:40 AM Jonathan Crall wrote: > > I just want to point out that I can think of a valid use case for `clf`. I'm > not sure if it was mentioned. > > In the case where you have a script that produces a lot of output, a common > task might be scrolling to the beginning to

[Python-ideas] Re: New feature

2020-10-16 Thread Jonathan Crall
I just want to point out that I can think of a valid use case for `clf`. I'm not sure if it was mentioned. In the case where you have a script that produces a lot of output, a common task might be scrolling to the beginning to check an output. If your screen was not fresh, and you had a lot of

[Python-ideas] Re: New feature

2020-10-16 Thread David Mertz
I agree with Guido here. Although I really don't care about the capability myself, it feels like enough people do want a "clear screen" function... and from the discussion, in feels like there are a LOT of variations in how to do it across different operating systems, OS versions, terminals,

[Python-ideas] Re: New feature

2020-10-16 Thread Rob Cliffe via Python-ideas
On 16/10/2020 13:55, Chris Angelico wrote: On Fri, Oct 16, 2020 at 11:08 PM Rob Cliffe wrote: On 16/10/2020 11:59, Chris Angelico wrote: On Fri, Oct 16, 2020 at 8:21 PM Rob Cliffe via Python-ideas wrote: On 13/10/2020 23:35, Guido van Rossum wrote: Can one of the educators on the list

[Python-ideas] Re: New feature

2020-10-16 Thread Eryk Sun
On 10/16/20, Barry Scott wrote: > > I find that you have to do this to turn on ANSI processing in CMD.EXE on > Window 10 and I assume earlier Windwows as wel: You mean the console-session host (conhost.exe). This has nothing to do with the CMD shell. People often confuse CLI shells (CMD,

[Python-ideas] Re: New feature

2020-10-16 Thread Barry Scott
> On 16 Oct 2020, at 14:44, Rob Cliffe via Python-ideas > wrote: > > > > On 16/10/2020 13:55, Chris Angelico wrote: >> >>> I do precisely that in many of my programs for e.g. single-line progress >>> displays. >>> But for multi-line output I don't know of any way to move the cursor >>>

[Python-ideas] Re: New feature

2020-10-16 Thread Rob Cliffe via Python-ideas
On 16/10/2020 13:55, Chris Angelico wrote: I do precisely that in many of my programs for e.g. single-line progress displays. But for multi-line output I don't know of any way to move the cursor back up. I work in Windows 10. Try \x1b[A to move up a line, should work. ChrisA Got it

[Python-ideas] Re: New feature

2020-10-16 Thread Joao S. O. Bueno
On Fri, 16 Oct 2020 at 08:00, Chris Angelico wrote: > On Fri, Oct 16, 2020 at 8:21 PM Rob Cliffe via Python-ideas > wrote: > > > > > > > > On 13/10/2020 23:35, Guido van Rossum wrote: > > > Can one of the educators on the list explain why this is such a > > > commonly required feature? I

[Python-ideas] Re: New feature

2020-10-16 Thread Chris Angelico
On Fri, Oct 16, 2020 at 11:08 PM Rob Cliffe wrote: > > > > On 16/10/2020 11:59, Chris Angelico wrote: > > On Fri, Oct 16, 2020 at 8:21 PM Rob Cliffe via Python-ideas > > wrote: > >> > >> > >> On 13/10/2020 23:35, Guido van Rossum wrote: > >>> Can one of the educators on the list explain why this

[Python-ideas] Re: New feature

2020-10-16 Thread Rob Cliffe via Python-ideas
On 16/10/2020 11:59, Chris Angelico wrote: On Fri, Oct 16, 2020 at 8:21 PM Rob Cliffe via Python-ideas wrote: On 13/10/2020 23:35, Guido van Rossum wrote: Can one of the educators on the list explain why this is such a commonly required feature? I literally never feel the need to clear

[Python-ideas] Re: New feature

2020-10-16 Thread Chris Angelico
On Fri, Oct 16, 2020 at 8:21 PM Rob Cliffe via Python-ideas wrote: > > > > On 13/10/2020 23:35, Guido van Rossum wrote: > > Can one of the educators on the list explain why this is such a > > commonly required feature? I literally never feel the need to clear my > > screen -- but I've seen this

[Python-ideas] Re: New feature

2020-10-16 Thread Rob Cliffe via Python-ideas
On 13/10/2020 23:35, Guido van Rossum wrote: Can one of the educators on the list explain why this is such a commonly required feature? I literally never feel the need to clear my screen -- but I've seen this requested quite a few times in various forms, often as a bug report "IDLE does not

[Python-ideas] Re: New feature

2020-10-15 Thread Guido van Rossum
I searched my own email archives and found that this is indeed frequently requested for IDLE. For example, Raymond Hettinger filed *two* different bug reports about it on behalf of his students, both closed as duplicates of https://bugs.python.org/issue6143, which has been open with frequent

[Python-ideas] Re: New feature

2020-10-15 Thread Mike Miller
On 2020-10-13 15:35, Guido van Rossum wrote: Can one of the educators on the list explain why this is such a commonly required feature? I literally never feel the need to clear my screen -- but I've seen this requested quite a few times in various forms, often as a bug report "IDLE does not

[Python-ideas] Re: New feature

2020-10-14 Thread ankith abhayan
The 2nd one. Regards On Wed, 14 Oct 2020, 5:47 am Steven D'Aprano, wrote: > Hello Ankith, > > > On Tue, Oct 13, 2020 at 11:37:25AM +0530, ankith abhayan wrote: > > Hi, > > I would like to request a new feature that allows you to clear the > console > > screen. > > Like in c++, the CLS function

[Python-ideas] Re: New feature

2020-10-14 Thread M.-A. Lemburg
On 14.10.2020 00:35, Guido van Rossum wrote: > Can one of the educators on the list explain why this is such a commonly > required feature? I literally never feel the need to clear my screen -- but > I've > seen this requested quite a few times in various forms, often as a bug report > "IDLE does

[Python-ideas] Re: New feature

2020-10-13 Thread MRAB
On 2020-10-14 00:46, Steven D'Aprano wrote: On Tue, Oct 13, 2020 at 03:35:58PM -0700, Guido van Rossum wrote: Can one of the educators on the list explain why this is such a commonly required feature? I literally never feel the need to clear my screen -- but I've seen this requested quite a

[Python-ideas] Re: New feature

2020-10-13 Thread Steven D'Aprano
Hello Ankith, On Tue, Oct 13, 2020 at 11:37:25AM +0530, ankith abhayan wrote: > Hi, > I would like to request a new feature that allows you to clear the console > screen. > Like in c++, the CLS function Can you be specific? I can think of at least three behaviours: 1. Move all existing

[Python-ideas] Re: New feature

2020-10-13 Thread Michael Smith
I occasionally find it useful to clear the screen when doing demos/presentations. I think the case for it is clear (hah) enough based on its long history and presence in many terminal emulators. But then again, the terminals I use and readline support it already, so I don't need python repl to do

[Python-ideas] Re: New feature

2020-10-13 Thread Steven D'Aprano
On Tue, Oct 13, 2020 at 03:35:58PM -0700, Guido van Rossum wrote: > Can one of the educators on the list explain why this is such a commonly > required feature? I literally never feel the need to clear my screen -- but > I've seen this requested quite a few times in various forms, often as a bug

[Python-ideas] Re: New feature

2020-10-13 Thread David Mertz
I teach a lot. But it's adults, and ones who have at least a little bit of programming experience (perhaps in a different language, but something). I've never had anyone request a "clear screen" command. Of course, I usually use Jupyter notebooks for teaching, so I'm not sure what that would

[Python-ideas] Re: New feature

2020-10-13 Thread Christopher Barker
I have never had one of my students as for this. Note that clearing the screen (command window these days) IS common -- at least I do ti a lot :-) -- but with a keystroke, not in code. I suspect Chris A is right -- this would be called for in a command-line / menu driven app that wasn't using

[Python-ideas] Re: New feature

2020-10-13 Thread Chris Angelico
On Wed, Oct 14, 2020 at 9:38 AM Guido van Rossum wrote: > > Can one of the educators on the list explain why this is such a commonly > required feature? I literally never feel the need to clear my screen -- but > I've seen this requested quite a few times in various forms, often as a bug >

[Python-ideas] Re: New feature

2020-10-13 Thread Guido van Rossum
Can one of the educators on the list explain why this is such a commonly required feature? I literally never feel the need to clear my screen -- but I've seen this requested quite a few times in various forms, often as a bug report "IDLE does not support CLS". I presume that this is a common thing

[Python-ideas] Re: New feature

2020-10-13 Thread Mike Miller
On 2020-10-13 06:19, Stestagg wrote: For example, the pypi `console` library provides a method: `console.sc.reset()` that behaves similarly to `CLS` on windows and also appears to be fairly reliable cross-platform. Yes, there is more to it than appears at first glance. There is resetting

[Python-ideas] Re: New feature

2020-10-13 Thread Stestagg
It's not uncommon for C++ tutorials etc, to refer to using: system("cls"); to clear the screen (in windows console environments only). I assume this is what ankith was talking about. The python equivalent would be: import os os.system('cls') or in the repl: _ = os.system('cls'). Note,

[Python-ideas] Re: New feature

2020-10-13 Thread Serhiy Storchaka
13.10.20 09:07, ankith abhayan пише: > I would like to request a new feature that allows you to clear the > console screen. > Like in c++, the CLS function There is no the CLS function in C++. ___ Python-ideas mailing list -- python-ideas@python.org To