原创 python 文件合併

兩文件合併  兩文件行合併爲一行import sys#建立點號 輸出序列1,2,3,4……到文件中File=open("E:\\test\\sift\\ID.txt","w")idNum=len(open("E:\\test\\sift\

原创 python GDAL的應用

from osgeo import gdalgdal.AllRegister()filePath="D://data3//J47G085041.tif"dataset=gdal.Open(filePath)

原创 Python DEM高程精度計算__新建空的元組,存入

import gdalimport sysimport osimport math                controlFile=open("D:\\DEM2\\11.txt","r")     

原创 python_文件遍歷、文件讀取、文件操作

一、文件遍歷import os   fileDir="D:" + os.sep + "data2"   for root, dirs, files in os.walk(fileDir):       for dir in dirs:  

原创 python 將print輸出保存到文本文件中

print輸出到文本import sysprint 'HEO=LLO'output=sys.stdoutoutputfile=open("D:\\DEM4\\2.txt","a")sys.stdout=outputfile中文輸出添加ty