2017-05-04 29 views
-1

如何在Python中創建列表視圖tkinter可以處理文本文件中的數據? 我想打開可能包含聯繫人列表的文本文件。Python列表視圖與文本文件一起工作

例如:

Name Address Mobile Rate 

,然後在列表視圖佈局的那些數據。

任何人都可以幫忙嗎?如果你想要增加你可以添加任何行

name = L[::2] # get every other item, starting with the first 
number = L[1::2] # get every other item, starting with the second 

回答

0

您可以創建在python列表中,如下所示:

seq = L[name:number] 

seq = L[::2] # get every other item, starting with the first 
seq = L[::2] # get every other item, starting with the second 

,或者你可以直接去下面提及。 我會建議你去用第一種方法