Last active
September 10, 2022 13:36
-
-
Save MedeirosJoel/2f108f1d24e7f917c140f53d995ad1c3 to your computer and use it in GitHub Desktop.
Uma função python que limpa o terminal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import system, name | |
from time import sleep | |
def cls(tEspera=0.0): | |
""" | |
Esta é uma função que limpa o terminal do python/OS | |
Utilizando a função OS do sistema ela recebe a interface de acesso ao terminal \n | |
Podeaguardar antes de limpar a tela para exibição de um resultado temporario em segundos | |
exemplos de uso: cls(5), cls(0.4), cls() | |
""" | |
sleep(tEspera) | |
if name == 'posix': system('clear') | |
elif name == 'nt': system('cls') | |
else: print("\n"*160) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment