python format from dictionary