I am trying to make a simple layout like this:
---------
- -
- ABC -
- -
---------
And I have tried two ways but failed:
1st method: Put the cursor at the right position, but I cannot seem to place the second vertical line where I want it:
# making first horizontal linefrom position 00
string_line = "-"*width
position00 = 0
self.summarylines.append(string_line.ljust(position00))
# making first vertical line from position 00
for i in range(height):
self.summarylines.append('-')
# making second horizontal line from position V0
poistion0V=position00+height
self.summarylines.append(string_line.ljust(poistion0V))
# making second vertical line from position H0
positionH0 = position00+width
for i in range(height):
self.summarylines.append('-'.ljust(positionH0))
2nd method: is to add the two vertical lines at the same time by adding the space in between them:
# making first horizontal linefrom position 00
string_line = "-"*width
position00 = 0
self.summarylines.append(string_line.ljust(position00))
# making first and second vertical line from position 00 + H0
for i in range(height):
self.summarylines.append('- -')
# making second horizontal line from position V0
poistion0V=position00+height
self.summarylines.append(string_line.ljust(poistion0V))
However, for this case I don’t know how is it possible to add just the right spaces that are as big as the widht of the horizontal line.
Either way, I have not suceeded in making either of them work.
Thanks in advance.
1 Answer