Re: Best way to report progress at fixed intervals

2008-12-10 Thread George Sakkis
On Dec 10, 2:50 am, Slaunger <[EMAIL PROTECTED]> wrote: > > Sorry, apparently I did not realize that at first sight. Anyway, I'd > rather avoid using further external modules besides the standard > batteries, as I would have to update several workstations with > different OSes (some of which I do n

Re: Best way to report progress at fixed intervals

2008-12-10 Thread Slaunger
On 10 Dec., 12:08, eric <[EMAIL PROTECTED]> wrote: > Don't mind if I give my shot ? > > def work(i): >     """ >     Dummy process function, which takes a random time in the interval >     0.0-0.5 secs to execute >     """ >     print "Work step %d" % i >     time.sleep(0.5 * random.random()) > > d

Re: Best way to report progress at fixed intervals

2008-12-10 Thread eric
Don't mind if I give my shot ? def work(i): """ Dummy process function, which takes a random time in the interval 0.0-0.5 secs to execute """ print "Work step %d" % i time.sleep(0.5 * random.random()) def workAll(work, verbose=True, max_iter=20, progress_interval=1.0):

Re: Best way to report progress at fixed intervals

2008-12-09 Thread Slaunger
On 10 Dec., 08:03, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > Slaunger <[EMAIL PROTECTED]> writes: > > On 10 Dec., 03:44, George Sakkis <[EMAIL PROTECTED]> wrote: > >> On Dec 9, 11:40 am, Slaunger <[EMAIL PROTECTED]> wrote: > > >> > I would therefore like some feedback on this proposed generic "

Re: Best way to report progress at fixed intervals

2008-12-09 Thread Arnaud Delobelle
Slaunger <[EMAIL PROTECTED]> writes: > On 10 Dec., 03:44, George Sakkis <[EMAIL PROTECTED]> wrote: >> On Dec 9, 11:40 am, Slaunger <[EMAIL PROTECTED]> wrote: >> >> > I would therefore like some feedback on this proposed generic "report >> > progress at regular intervals" approach presented here. W

Re: Best way to report progress at fixed intervals

2008-12-09 Thread Slaunger
On 10 Dec., 03:44, George Sakkis <[EMAIL PROTECTED]> wrote: > On Dec 9, 11:40 am, Slaunger <[EMAIL PROTECTED]> wrote: > > > I would therefore like some feedback on this proposed generic "report > > progress at regular intervals" approach presented here. What could I > > do better? > > There is a py

Re: Best way to report progress at fixed intervals

2008-12-09 Thread Jon Morton
I think there is something I've run into, and it will only ever get _loaded_ once. See below for sour output of an easy example case of my problem. The wxPython lib is big, so it may have bugs, but pySer l and pure python (no C/C++ directly, event thought it uses os.open/ close & termios that

Re: Best way to report progress at fixed intervals

2008-12-09 Thread George Sakkis
On Dec 9, 11:40 am, Slaunger <[EMAIL PROTECTED]> wrote: > I would therefore like some feedback on this proposed generic "report > progress at regular intervals" approach presented here. What could I > do better? There is a pypi package that might do what you're looking for (haven't used it though

Re: Best way to report progress at fixed intervals

2008-12-09 Thread Slaunger
On 10 Dec., 00:11, [EMAIL PROTECTED] wrote: > >>          # Monitoring loop. > >>          loops = 0 > >>          # We're going to loop ten times per second using an integer count, > >>          # so multiply the seconds parameter by 10 to give it the same > >>          # magnitude. > >>          

Re: Best way to report progress at fixed intervals

2008-12-09 Thread rdmurray
On Tue, 9 Dec 2008 at 13:27, Slaunger wrote: On 9 Dec., 19:35, [EMAIL PROTECTED] wrote: I felt like a little lunchtime challenge, so I wrote something that I think matches your spec, based on your sample code. ?This is not necessarily the best implementation, but I think it is simpler and clear

Re: Best way to report progress at fixed intervals

2008-12-09 Thread Slaunger
On 9 Dec., 19:35, [EMAIL PROTECTED] wrote: > > I felt like a little lunchtime challenge, so I wrote something that > I think matches your spec, based on your sample code.  This is not > necessarily the best implementation, but I think it is simpler and > clearer than yours.  The biggest change is t

Re: Best way to report progress at fixed intervals

2008-12-09 Thread MRAB
Slaunger wrote: Hi comp.lang.python I am a novice Python 2.5 programmer, who write some cmd line scripts for processing large amounts of data. I would like to have possibility to regularly print out the progress made during the processing, say every 1 seconds, and i am wondering what a proper g

Re: Best way to report progress at fixed intervals

2008-12-09 Thread rdmurray
On Tue, 9 Dec 2008 at 08:40, Slaunger wrote: I am a novice Python 2.5 programmer, who write some cmd line scripts for processing large amounts of data. I would like to have possibility to regularly print out the progress made during the processing, say every 1 seconds, and i am wondering what a

Best way to report progress at fixed intervals

2008-12-09 Thread Slaunger
Hi comp.lang.python I am a novice Python 2.5 programmer, who write some cmd line scripts for processing large amounts of data. I would like to have possibility to regularly print out the progress made during the processing, say every 1 seconds, and i am wondering what a proper generic way to do t