report progress from C function

Michael S msherman77 at yahoo.com
Tue Oct 31 20:56:31 EST 2006


> BTW, why did you rewrite in C rarher than using
> Pyrex?
I was not aware of pyrex. I didn't really mind doing
some C, it made me remember the syntax.

Thanks a lot. I did think that I could pack a function
address as a parameter.

--- John Machin <sjmachin at lexicon.net> wrote:

> Michael S wrote:
> > Good day all.
> >
> > I rewrote part of my program in C, it's a usually
> a
> > long task. I wanted to be able to report the
> progress
> > back to my python program. In  my module (in
> addition
> > to the function that performs the above-mentioned
> > task) there is a function that returns the
> variable,
> > indicating the progress. However I am not sure how
> to
> > call it. Once I call the C function that does the
> work
> > (it's a while loop that takes minutes sometimes) I
> > can't call that progress function.
> > Any ideas?
> >
> 
> What do you expect your "python program" to be doing
> between calls to
> the get_progress function?
> 
> Here's a sketch of one possible way of doing
> something useful: add the
> following 2 args to your C "does the work function":
> (1) Python function object to be called every n
> times around the while
> loop or every nth other event or every n
> milliseconds or whatever
> (2) n
> 
> BTW, why did you rewrite in C rarher than using
> Pyrex?
> 
> Cheers,
> John
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 




More information about the Python-list mailing list