-
Notifications
You must be signed in to change notification settings - Fork 727
/
FramedText.py
55 lines (49 loc) · 1.09 KB
/
FramedText.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
import os
borderstyle = "║"
def drawboxtext(dat):
height = len(dat)
y = 0
while y < height:
dat[y] = " "+dat[y]+" "
y += 1
width = len(max(dat, key=len))+1
counter = 0
x = 0
line = "╔"
while x < width-1:
line = line + "═"
x += 1
line = line + "╗"
print(line)
while counter < height:
reqspaces = width -1- len(dat[counter])
xsp = ""
while reqspaces > 0:
xsp = xsp + " "
reqspaces -= 1
print(borderstyle+dat[counter]+xsp+borderstyle)
counter += 1
x = 0
line = "╚"
while x < width-1:
line = line + "═"
x += 1
line = line + "╝"
print(line)
print("Framed text generator by Julian Drake.\n")
print("")
while True:
print("Enter the items in the frame. (Leave blank to submit.)")
items=[]
i=0
while 1:
i+=1
item=input('Enter item %d: '%i)
if item=="":
break
items.append(item)
print("")
drawboxtext(items)
print("")
input("")
os.system('cls')