Fixed clearing the screen under live macOS
This commit is contained in:
parent
4a3981e10c
commit
417241acb5
1 changed files with 5 additions and 1 deletions
|
|
@ -728,7 +728,11 @@ def choice(choices, prompt='答えろ!'):
|
||||||
def clear_screen():
|
def clear_screen():
|
||||||
"""Simple wrapper for clear/cls."""
|
"""Simple wrapper for clear/cls."""
|
||||||
cmd = 'cls' if os.name == 'nt' else 'clear'
|
cmd = 'cls' if os.name == 'nt' else 'clear'
|
||||||
subprocess.run(cmd, check=False, shell=True, stderr=subprocess.PIPE)
|
proc = subprocess.run(cmd, check=False, shell=True, stderr=subprocess.PIPE)
|
||||||
|
|
||||||
|
# Workaround for live macOS env
|
||||||
|
if proc.returncode != 0:
|
||||||
|
print('\033c')
|
||||||
|
|
||||||
|
|
||||||
def color_string(strings, colors, sep=' '):
|
def color_string(strings, colors, sep=' '):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue