0
titles =('IP','URL')
t = PrettyTable([])
list1 = ['8.8.8.8', '8.8.8.8', '8.8.8.8', '8.8.8.8', ]
list2 = ['http://www.example.com', 'http://www.example.com', ]
for title,lst in zip(titles,itertools.izip_longest(list1,list2,fillvalue="")):
    t.add_column(title,lst)

print t

显示代码输出:

代码提供了什么

显示我真正想要的:

我想要的是

4

0 回答 0