I am making a discord bot in python. Today I scraped a website and I wanted to make a string with all the info I scraped. The problem I am having is that I want to create a vertical line between the different sections, but some strings are longer then others, for example I want to create this:
Apple \s |
Pear(\s) |
But because the 2 strings have a different length the '|' won't be a straight line. The code I have right now is this:
def print_tracked_xp(self, XpDict):
trackedStuff = """Skill | Today's XP | Yesterday's XP | Weekly XP \n"""
for key in XpDict:
trackedStuff += key + ' | ' + XpDict[key]['Daily XP'] + ' | ' + XpDict[key]['Yesterdays XP'] + ' | ' + XpDict[key]['Weekly XP'] + '\n'
return trackedStuff
As output i get this:
https://i.stack.imgur.com/GpzRu.jpg
But I want to get something like this:
https://i.stack.imgur.com/Z5aiy.jpg