Skip to content

Instantly share code, notes, and snippets.

@avalanchy
Forked from mildsunrise/clear.py
Last active August 29, 2015 13:57
Show Gist options
  • Save avalanchy/9626338 to your computer and use it in GitHub Desktop.
Save avalanchy/9626338 to your computer and use it in GitHub Desktop.
How to clear python interpreter console?
import os
import subprocess
if os.name in ('ce', 'nt', 'dos'):
def clear():
subprocess.call('cls', shell=True)
elif 'posix' in os.name:
def clear():
subprocess.call('clear', shell=True)
else:
def clear():
print('\n'*120)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment