-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjournosOut.py
103 lines (86 loc) · 1.69 KB
/
journosOut.py
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import colorStack
import os
import time
import sys
pauseLength=0.009
def out(s):
sys.stdout.write(s)
sys.stdout.flush()
def outBlue(s):
colorStack.pushBlue()
sys.stdout.write(s)
sys.stdout.flush()
colorStack.popColor()
def outPurple(s):
colorStack.pushPurple()
sys.stdout.write(s)
sys.stdout.flush()
colorStack.popColor()
def animPrint(s):
for i in range(0,len(s)):
sys.stdout.write(s[i])
sys.stdout.flush()
time.sleep(pauseLength)
def animPrintRed(s):
colorStack.pushRed()
animPrint("\n"+s+"\n")
colorStack.popColor()
def animPrintBlue(s):
colorStack.pushBlue()
animPrint("\n"+s+"\n")
colorStack.popColor()
def animPrintPurple(s):
colorStack.pushPurple()
animPrint("\n"+s+"\n")
colorStack.popColor()
def animPrintGreen(s):
colorStack.pushGreen()
animPrint("\n"+s+"\n")
colorStack.popColor()
def animPrintCyan(s):
colorStack.pushCyan()
animPrint("\n"+s+"\n")
colorStack.popColor()
def printRed(s):
colorStack.pushRed()
print
print(s)
print
colorStack.popColor()
def printBlue(s):
colorStack.pushBlue()
print
print(s)
print
colorStack.popColor()
def printPurple(s):
colorStack.pushPurple()
print
print(s)
print
colorStack.popColor()
def printGreen(s):
colorStack.pushGreen()
print
print(s)
print
colorStack.popColor()
def printCyan(s):
colorStack.pushCyan()
print
print(s)
print
colorStack.popColor()
def fullWidthBorder(border='~ o '):
rows,cols=os.popen('stty size','r').read().split()
cols=int(cols)
ret=""
for i in range(0,cols): ret+=border[i%len(border)]
return ret
def endSection():
breakSize=3
lineBr=""
for i in range(0,breakSize): lineBr+='\n'
lineBr+=fullWidthBorder()
for i in range(0,breakSize): lineBr+='\n'
animPrintRed(lineBr)