MerryChristmas icon indicating copy to clipboard operation
MerryChristmas copied to clipboard

OS with `posix` works not very well

Open guoruibiao opened this issue 6 years ago • 2 comments

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')

guoruibiao avatar Dec 26 '18 08:12 guoruibiao

thank you for feedback i have updated

plainoldcheese avatar Dec 26 '18 19:12 plainoldcheese

I have tried once more although I cannot test on a mac, I did test on windows and windows subsystem for linux.

plainoldcheese avatar Dec 27 '18 20:12 plainoldcheese