####################################################################
# python 读取TXT到数组 列表去重,不打乱原来的顺序
# 刚学写的不好请大家见谅
####################################################################
def open_txt(): #打开TXT文本写入数组
try:
infile = file('admin.txt', 'r')
xxx = file('admin.txt', 'r')
for xxx_line in xxx.readlines():
passlist.append(xxx_line)
xxx.close()
except:
return 0
def list_del(): #清空list列表
try:
i = 0 #得到list的第一个元素
while i
希望本文所述对大家的Python程序设计有所帮助。
查看更多关于python读取TXT到数组及列表去重后按原来顺序排序的方法的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did89001