On 19 September 2016 at 03:40, Chris Angelico <ros...@gmail.com> wrote:
> On Mon, Sep 19, 2016 at 12:32 PM, Steven D'Aprano <st...@pearwood.info> wrote:
>> (The fallback if all else fails is easy: get the height of the terminal,
>> in lines, and print that many blank lines.)
> Assuming you can get the height in lines. Have you tried that in the
> default Windows shell? I don't think tcgetattr works on Windows.
shutil.get_terminal_size() is available on all platforms.
I don't think it would be unreasonable to add shutil.clear_terminal()
(at the moment, get_terminal_size is the only "terminal handling"
function in shutil, but it would be the obvious place to add others if
we chose to do so).
Python-ideas mailing list
Code of Conduct: http://python.org/psf/codeofconduct/