1.目的
读取cal.txt内容,然后通过python脚本转化为list内容
2. 文件内容
cal.txt
12
13
14
15
16
#!/usr/bin/python
#coding = UFT-8
result=[]
fd = file( "cal.txt", "r" )
for line in fd.readlines():
result.append(list(map(int,line.split(','))))
print(result)
for item in result:
for it in item:
print it
[[12], [13], [14], [15], [16]]
12
13
14
15
16