Python 3.x 基于第二列值的Python拆分和打印

Python 3.x 基于第二列值的Python拆分和打印,python-3.x,Python 3.x,我有一个字符串输出返回给我,格式如下 Skip this first line of queues ... reply_105d621c2a624832a6d10ee9767bfb0a 0 reply_36b762860c9a43b89ed33da39594db98 0 reply_5b0ada5aee034f3682ff8c6dc2600996 10 reply_36b762860c9a43b89ed33da39594db98 0 reply_5b0ada5aee034f36

我有一个字符串输出返回给我,格式如下

Skip this first line of queues ...

reply_105d621c2a624832a6d10ee9767bfb0a  0

reply_36b762860c9a43b89ed33da39594db98  0

reply_5b0ada5aee034f3682ff8c6dc2600996  10

reply_36b762860c9a43b89ed33da39594db98  0

reply_5b0ada5aee034f3682ff8c6dc2600996  20

reply_36b762860c9a43b89ed33da39594db98  0

reply_5b0ada5aee034f3682ff8c6dc2600996  0
如何拆分此字符串,以便跳过第一行,然后仅打印值不为0的行

我的解决方案:

queue = lines.split('\n')[1:-1]
queue = dict([i.split('\t',1) for i in queue])
queue = {k:v for (k,v) in queue.iteritems() if v!='0'}