-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.py
More file actions
31 lines (25 loc) · 709 Bytes
/
util.py
File metadata and controls
31 lines (25 loc) · 709 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
28
29
30
31
# Import sleep to show output for a period of time.
from time import sleep
# Import only system from os.
from os import system, name
# Clears the terminal screen
def clear():
# for windows
if name == 'nt':
_ = system('cls')
# for mac and linux(here, os.name is 'posix')
else:
_ = system('clear')
# Prints the message and waits for 1 second.
def display(message):
print(message)
sleep(1)
# Prints the given hand.
def print_hand(cards, sleep_duration = 0):
for card in cards:
if card[1:] == "11":
print("[" + card[0] + "A" + "] ", end = '')
else:
print("[" + card + "] ", end = '')
print("")
sleep(sleep_duration)