方法一:
f = open("Proc_Data.txt")             # 返回一个文件对象  
line = f.readline()             # 调用文件的 readline()方法  
while line:  
    print line,                 # 后面跟 ‘,‘ 将忽略换行符  
    # print(line, end = ‘‘)   # 在 Python 3中使用  
    line = f.readline()  
  
f.close()  for line in open("Proc_Data.txt"):  
    print line, f = open("F:\\wfpdm\\My_Proc_Data_ZXTZ.txt","r")  
lines = f.readlines()#读取所有内容  
for line in lines  
    print line  原文:http://www.cnblogs.com/gccbuaa/p/6859842.html