pyphon 将文件数据改成浮点型

 

 

 

pyphon  将文件数据改成浮点型
 1 # -*- coding: utf-8 -*-
 2 """
 3 Created on Thu Jan 09 10:57:52 2014
 4 
 5 @author: wendy
 6 """
 7 
 8 #f=open("Data.txt","r")
 9 #x=f.read()
10 #print x
11 
12 import string
13 f=open("Data.txt","r")
14 for Eachline in f:
15     Eachline=Eachline.replace("\n"," ")
16     Eachline=Eachline.split("    ")
17     
18     #for i in Eachline:
19         #i.strip() 
20     for i in Eachline:
21         i=string.atof(i)
22         print i
23        
24     
25 f.close
pyphon  将文件数据改成浮点型

pyphon 将文件数据改成浮点型

上一篇:Block语法


下一篇:ECS使用初体验