plainoldcheese / MerryChristmas

🎄 A python christmas tree in the terminal.
27 stars 7 forks source link

OS with `posix` works not very well #1

Open guoruibiao opened 5 years ago

guoruibiao commented 5 years ago

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')
plainoldcheese commented 5 years ago

thank you for feedback i have updated

plainoldcheese commented 5 years ago

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