参考 Python将txt文件内容转换成列表 - 云+社区 - 腾讯云
方法一:
# -*- coding:utf-8 -*-
f = open(r'ip.txt','r')
a = list(f)
print(a)
f.close()
方法二:
# -*- coding:utf-8 -*-
f = open(r'ip.txt','r')
a=[i for i in f]
print(a)
f.close()
参考 Python将txt文件内容转换成列表 - 云+社区 - 腾讯云
方法一:
# -*- coding:utf-8 -*-
f = open(r'ip.txt','r')
a = list(f)
print(a)
f.close()
方法二:
# -*- coding:utf-8 -*-
f = open(r'ip.txt','r')
a=[i for i in f]
print(a)
f.close()