python clear console output without os code example
Example 1: python clear console
import sys, os
os.system('cls')
Example 2: python clear console
import os
def clearConsole():
command = 'clear'
if os.name in ('nt', 'dos'): # If Machine is running on Windows, use cls
command = 'cls'
os.system(command)
clearConsole()