Skip to content

bpo-43432: add function clear to module os#24784

Closed
parsampsh wants to merge 3 commits into
python:mainfrom
parsampsh:bpo-43432
Closed

bpo-43432: add function clear to module os#24784
parsampsh wants to merge 3 commits into
python:mainfrom
parsampsh:bpo-43432

Conversation

@parsampsh

@parsampsh parsampsh commented Mar 8, 2021

Copy link
Copy Markdown

Now we can run:

from os import clear
clear()

instead of:

import os

if os.name == 'nt':
      os.system('cls')
else:
      os.system('clear')

https://bugs.python.org/issue43432

@github-actions

github-actions Bot commented Apr 8, 2021

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 8, 2021
@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label Aug 5, 2022
@encukou

encukou commented Mar 27, 2024

Copy link
Copy Markdown
Member

Not this way, sorry. The clear command is non-standard; some minimal systems don't include it at all.
Clearing the screen is not something the OS exposes. There might be a better place for such a command elsewhere, though.

@encukou encukou closed this Mar 27, 2024
@parsampsh parsampsh mannequin mentioned this pull request Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants