내부의 ProgressBar를 사용하는 방법 : for i in xrange(len(sr)):
기능이 과정을 여러 번있을 것이다 파이썬 : 나는 다음과 같은 기능을 사용하고 내 기능
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()
.
len(sr)
은 약 50 만 개이며 기다려야하는 시간을 생각하기 위해 진행 표시 줄을 삽입하고 싶습니다 (금요일). 나는 다음과 같은 질문이 있습니다
64 비트 윈도우 OS에 파이썬 (27)에 대해 "가장 쉬운"진행 막대가
- ?
- progressbar module을 찾았지만이 단계 후에 easy_install 진행률 표시 줄을 사용하는 데 문제가 있습니다.
- 어디서 진행률 표시 줄을 삽입 할 수 있습니까?
는 http://stackoverflow.com/questions/3160699/python-progress-bar – root