-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutility.py
More file actions
27 lines (24 loc) · 717 Bytes
/
Copy pathutility.py
File metadata and controls
27 lines (24 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os # detect file system type
import subprocess # to replace deprecated os.system command
class FCOLOR:
# https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797
BLACK = "\033[30m"
RED = "\033[31m"
GREEN = "\033[32m"
YELLOW = "\033[33m"
BLUE = "\033[34m"
MAGENTA = "\033[35m"
CYAN = "\033[36m"
WHITE = "\033[37m"
DEFAULT = "\033[39m"
RESET = "\033[0m"
BOLD = "\033[1m"
ITALIC = "\033[3m"
UNDERLINE = "\033[4m"
BLINKING = "\033[5m"
STRIKETHROUGH = "\033[9m"
def clear_console():
if os.name == "nt": # for Windows
subprocess.run("cls")
else: # for Linux/Mac
subprocess.run("clear")