1.获取G:/python/db2pd_sourcedb_tab.txt文件第10行的内容
import linecache
# get the  content of line
def get_line_context(num):
    theline = linecache.getline("G:/python/db2pd_sourcedb_tab.txt", num)  # 第一个参数指读取的文件,第二个参数指文件的行数
    print(theline)
def main():
    get_line_context(10)
if __name__ == "__main__":
    main()
 
2.执行结果
0x00002AAB31BE0080 5     DMS  Large   8192   32       Yes  32       1     1         Def 1        0          31           Yes  QCASN
						
							版权声明:本文为博主原创文章,未经博主允许不得转载。
Python

					
				
			

