Create a one week agenda in python
Question: I'm starting studying python and in particular I'm starting studying the
dictionary. I saw an exercise and I decide to solve it. The exercise asks to
create a one week agenda in python using dictionaries. Nothing too complicate
but I have also to insert the appointment that the user wants to insert. I
create something, not too difficult, but I don't know how to create a design
of the agenda. I did something:

    
    
    from collections import OrderedDict
    line_new = ''
    d = {}
    d = OrderedDict([("Monday", "10.30-11.30: Sleeping"), ("Tuesday", "13.30-15.30: Web Atelier"), ("Wednsday", "08.30-10.30: Castle"), ("Thursday", ""), ("Friday", "11.30-12.30: Dinner"), ("Saturday",""), ("Sunday","")])
    for key in d.keys():
        line_new = '{:>10}\t'.format(key)
        print(line_new)
    print("|               |                          |                              |                          |                      |                 |                       |")
    print("|               |                          |                              |                          |                      |                 |                       |")
    print("|               |                          |                              |                          |                      |                 |                       |")
    

Where the output is:

Monday  
Tuesday  
Wednsday  
Thursday  
Friday  
Saturday  
Sunday

And the lines to create the idea of a table. How can I put the days all on one
line using dictionary? I know how to do it with strings (with format) but I
don't know how to do it with the keys od the dictionary Can you help me?

EDIT The output I'm looking for is something like:

    
    
    Monday       Tuesday     Wednesday   Thursday     Friday    Saturday    Sunday
    
    |           |          |             |         |          |           |        |
    |           |          |             |         |          |           |        |
    |           |          |             |         |          |           |        |
    |           |          |             |         |          |           |        |
    

With some space more between the days (I cannot insert it here) And the lines
that create a division between the days

![Update to the output after Wasosky's
solution](http://i.stack.imgur.com/Fjs1R.png)

Update to the output after Wasowsky's solution


Answer: 
    # you can save your formatting as a string to stay consistent
    fmt = '{txt:>{width}}' 
    
    # calculate how much space you need instead of guessing:
    maxwidth = max(len(day) for day in d.keys()) 
    
    # join formatted strings with your separator and print
    separator = '   '
    print separator.join(fmt.format(txt=day, width=maxwidth) for day in d.keys())
    
    # you can use the same formatter to print other rows, just change separator
    separator = ' | '
    for _ in range(3):
        print ' | '.join(fmt.format(txt='', width=maxwidth) for day in d.keys())    
    

Output:

    
    
      Monday    Tuesday   Wednsday   Thursday     Friday   Saturday     Sunday
             |          |          |          |          |          |         
             |          |          |          |          |          |         
             |          |          |          |          |          |      
    

