I tried it on my MacBook, but command clear works not very well. It may be a suitable way to use module platform, and i overrided the function of clear.
import termcolor
import random
import time
import datetime
import platform
from os import system, name
from colorama import init
from termcolor import colored
def clear():
name = platform.system()
if name == "Windows":
_ = system("cls")
else:
# Darwin Linux
_ = system("clear")
#def clear():
# # check if windows
# if name == 'nt':
# _ = system('cls')
# # if *nix
# else:
# _ = system('clear')
I tried it on my MacBook, but command
clear
works not very well. It may be a suitable way to use moduleplatform
, and i overrided the function ofclear
.