[issue43432] Add function `clear` to the `os` module

2021-03-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

If you write a flexible Text ui program, you should use functions provided by a 
text ui library which you use to clear the screen or a part of screen.

If you want to call an external command, use os.system(), os.popen() or more 
flexible subprocess module. But I do not think it will help with Text UI.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43432] Add function `clear` to the `os` module

2021-03-08 Thread parsa mpsh


parsa mpsh  added the comment:

Well, some times we are writing a flexible Text ui program. we may use `clear` 
lot of times. This should be used when we haven't any valuable data on the 
screen. Also, who that uses this function, knows this will clear valuable data 
:). Sometimes also i use this command. but every time a should check that is 
this operation windows or not, to determine `clear` or `cls`. I think this is 
very helpful for making this easier.
The best feature of Python is its simplicity and power. More helper functions 
to make the code shorter and knowable, is a good thing for Python. Also about 
the Windows API instead of `cls`, i don't know more thing. But i think its not 
a big problem and `cls` works.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43432] Add function `clear` to the `os` module

2021-03-08 Thread Eryk Sun


Eryk Sun  added the comment:

The idea of adding some kind of clear_screen() function in the os or shutil 
module was discussed extensively on python-ideas a few months ago:

https://mail.python.org/archives/list/python-id...@python.org/thread/EWQ2BOL3WVZAU2V2MT3HLXN3AEBHANNZ
https://mail.python.org/archives/list/python-id...@python.org/thread/N2G5MDPST6IMUQCK6LLAUOVIJIOOC2XJ

I would not want to clear the terminal scrollback buffer, in which case the 
implementation in Windows would need to use the console API and/or VT sequences 
instead of the CMD shell's CLS command.

--
nosy: +eryksun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43432] Add function `clear` to the `os` module

2021-03-08 Thread parsa mpsh


Change by parsa mpsh :


--
keywords: +patch
pull_requests: +23550
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24784

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43432] Add function `clear` to the `os` module

2021-03-08 Thread parsa mpsh


New submission from parsa mpsh :

I wanna add a new function named `clear` to the os module.
This function runs the `clear` command in the os.
but this function checks that is os windows, if yes, runs `cls`.
I'm working on my patch.

--
components: Library (Lib)
messages: 388262
nosy: parsampsh
priority: normal
severity: normal
status: open
title: Add function `clear` to the `os` module
type: enhancement
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com