[Python-ideas] Re: 'Infinity' constant in Python

2020-10-17 Thread Rob Cliffe via Python-ideas
On 11/10/2020 22:47, Wes Turner wrote: Indeed, perhaps virtual particles can never divide by zero and thus the observed laws of thermodynamic systems are preserved. Would you please be so kind as to respond in the main thread so that this is one consecutive thread? No, 2 times

[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-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 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 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 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 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 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 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 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 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