Use of python progress bar in script
<p>I want to show progress bar in my script because it takes a lots of time to execute while working on huge files.I gone through the <a href="http://code.google.com/p/python-progressbar/" rel="nofollow">python progressbar module</a></p>

<p>and examples also its good and very intresting to use but as per examples all values are predefine .As we can't guess the max execution time of programm or function.So i am not able to figure out how should i use progress bar function in my sctipt</p>

<pre><code>for data in files:
     crawl_data(data)
</code></pre>

<p>this is the crawl_data function which take time so how can i set the progress bar values </p>

<pre><code>pbar = ProgressBar(widgets=[Percentage(), Bar()], maxval=300).start()
for i in range(300):
    time.sleep(0.01)
    pbar.update(i+1)
pbar.finish()
</code></pre>

<p>how can i define this range and maxval values in above lines of code.</p>
