This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define swap(a, b) do { \ | |
typeof(a) temp = a; \ | |
a = b; \ | |
b = temp; \ | |
} while (0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import sys | |
toolbar_width = 40 | |
current = 0 | |
for i in range(1, 101): | |
time.sleep(0.1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import time | |
def spinning_cursor(): | |
while True: | |
for cursor in '|/-\\': | |
yield cursor | |
def start(): | |
spinner = spinning_cursor() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
if sys.platform() == "win32": | |
def clear(): os.system("cls") | |
elif sys.platform() == "linux2": | |
def clear(): os.system("clear") | |
elif sys.platform() == "cygwin": | |
def clear(): os.system("clear") | |
elif sys.platform() == "darwin": |
NewerOlder