裏面我使用下面的函數:的Python:如何使用進度我的功能
def LAS2TXTGridClip(inFile,poly,MinPoints=1):
sf = shapefile.Reader(poly) #open shpfile
sr = sf.shapeRecords()
poly_filename, ext = path.splitext(poly)
inFile_filename = os.path.splitext(os.path.basename(inFile))[0]
for i in xrange(len(sr)):
verts = np.array(sr[i].shape.points,float)
record = sr[i].record[0]
inside_points = [p for p in lasfile.File(inFile,None,'r') if pnpoly(p.x, p.y, verts)]
if len(inside_points) >= MinPoints:
file_out = open("{0}_{1}_{2}.txt".format(poly_filename, inFile_filename, record), "w")
for p in inside_points:
file_out.write("%s %s %s %s %s %s %s %s %s %s %s" % (p.x, p.y, p.z, p.intensity,p.return_number,p.number_of_returns,p.scan_direction,p.flightline_edge,p.classification,p.scan_angle,record)+ "\n")
file_out.close()
其中for i in xrange(len(sr)):
的功能將過程幾次。 len(sr)
約爲50萬,我希望插入一個進度條,以便了解我需要等待的時間(星期五)。我有以下問題:
- 這是在Windows操作系統上的Python 27「最好,最簡單」的進度條 64位?
- 我發現progressbar module但我有問題使用 easy_install進度條在這一步之後。
- 哪裏是插入進度條的最佳位置?
閱讀,http://stackoverflow.com/questions/3160699/python-progress-bar – root