-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_message.py
47 lines (38 loc) · 1.21 KB
/
create_message.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
# ____________________
# @=____________________=@
# \ \
# | |
# | |
# | This is a scroll |
# \__________________\
# @=__________________=@
def create_scroll (printme) :
lines = printme.split('\n')
max_len = 0
for line in lines:
if len(line) > max_len :
max_len = len(line)
scroll = []
scroll.append( " _"+'_'*max_len+"__")
scroll.append( "@=_"+'_'*max_len+"__=@")
scroll.append( " \\"+' '*max_len+" \ ")
scroll.append( " |"+' '*max_len+" | ")
for line in lines:
scroll.append( " | "+line+' '*(max_len - len(line))+" | ")
scroll.append( " |"+' '*max_len+" | ")
scroll.append( " |"+' '*max_len+" | ")
scroll.append( " \\"+'_'*max_len+"__\ ")
scroll.append( "@=_"+'_'*max_len+"__=@")
return scroll
def create_dialog (printme) :
lines = printme.split('\n')
max_len = 0
for line in lines:
if len(line) > max_len :
max_len = len(line)
dialog = []
dialog.append( "+-"+'-'*max_len+"-+")
for line in lines:
dialog.append( "| "+line+' '*(max_len - len(line))+" |")
dialog.append( "+-"+'-'*max_len+"-+")
return dialog