python中bar函数的用法_Python:如何在函数中使用progressbar

我正在使用以下函数: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操作系统上的python27来说,哪一个是“最简单的”progressbar

64位?在

我找到了progressbar module,但我无法使用

在这一步之后轻松安装progressbar。在

插入progressbar的最佳位置在哪里?在

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值