Skip to content

Instantly share code, notes, and snippets.

@voyeg3r
Forked from anonymous/gist:321909
Created March 4, 2010 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voyeg3r/322022 to your computer and use it in GitHub Desktop.
Save voyeg3r/322022 to your computer and use it in GitHub Desktop.
Limpando o terminal no python
# source: http://stackoverflow.com/questions/517970/how-to-clear-python-interpreter-console
import os
def cls():
os.system(['clear','cls'][os.name == 'nt'])
# now, to clear the screen
cls()
# também achei uma opção assim:
# http://forums.devshed.com/python-programming-11/how-works-os-system-clear-and-cls-584090.html
os.system(['clear','cls'][1])
@Welbber
Copy link

Welbber commented Nov 17, 2017

Olá, estou com problema na hora de limpar a tela. estou trabalhando com o pycham e ele não limpa o terminal de jeito nenhum. Toda vez que uso o comando "os.system('cls') ele colocar uma seta no próximo print abaixo dele.

@adonissilver
Copy link

it worked perfectly!!! Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment