python字典格式打印输出

python字典格式打印输出,python,dictionary,format,key,Python,Dictionary,Format,Key,我试图以格式化的方式打印一个字典,每个键有两个值,其中键与值分开,没有任何括号或comas,只是缩进平面文本,例如: ---我的书签管理器-- 编号、姓名、地址 1.谷歌学者网站1 而不是: ---我的书签管理器-- 编号、名称、地址 __ 1('谷歌学者','网站1') 这是我的密码: web_pages = {1:('Google Scholar','website1'), 2:('Moodle','website2'), 3:('BBC','websit

我试图以格式化的方式打印一个字典,每个键有两个值,其中键与值分开,没有任何括号或comas,只是缩进平面文本,例如:

---我的书签管理器--

编号、姓名、地址

1.谷歌学者网站1

而不是:

---我的书签管理器--

编号、名称、地址

__

1('谷歌学者','网站1')

这是我的密码:

web_pages = {1:('Google Scholar','website1'),
         2:('Moodle','website2'),
         3:('BBC','website3'),
         4:('Webmail','website4')}

##-------output_structure_top---------------------------
def output_structure_top ():
    print "--- MY BOOKMARK MANAGER --- "+"\n"  
    print "Number"+" "*10 +"Name"+" "*30+"Address \n"
    print "-"*60+"\n"

##----output_structure_bottom------------------------
def output_structure_bottom():
    print "-"*60+"\n"

##----------------------------------------------------

output_structure_top ()
for key, value in web_pages.iteritems():
    print key, value
output_structure_bottom()
web_pages = {1:('Google Scholar','website1'),
         2:('Moodle','website2'),
         3:('BBC','website3'),
         4:('Webmail','website4')}

##-------output_structure_top---------------------------
def output_structure_top ():
    print "--- MY BOOKMARK MANAGER --- "+"\n"  
    print "Number"+" "*10 +"Name"+" "*30+"Address \n"
    print "-"*60+"\n"

##----output_structure_bottom------------------------
def output_structure_bottom():
    print "-"*60+"\n"

##----------------------------------------------------
def output_structure_value(key,value):
    print (str(key) +" "*10+ value[0] +" "*30 +value[1])


output_structure_top ()
for key, value in web_pages.iteritems():
    output_structure_value(key,value)
output_structure_bottom()