是否可以将列表列表导出到,并且最初仍对其进行维护?

2024-10-03 11:12:19 发布

您现在位置:Python中文网/ 问答频道 /正文

textFileLists = [[str1, str2, str3], [str1, str2, str3], [str1, str2, str3]]    
data = open('Data for A11.1.txt', 'r')    
read = data.read()    
new = []    
for i in read:       
      new.append(i.split('\n'))

print(new)

是否可以将列表列表导出到,并且最初仍对其进行维护


Tags: intxt列表newforreaddataopen