473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

report progress from C function

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?

Thanks in advance,
Michael
Oct 31 '06 #1
3 1131
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

Oct 31 '06 #2
Michael S wrote:
I downloaded Pyrex and ran it through their own
example. The code looks quite messy, and I even saw a
few "goto"s.
looked at the assembler output from your C compiler lately?

</F>

Nov 1 '06 #3
"Fredrik Lundh" <fr*****@pythonware.comwrote:
Michael S wrote:
I downloaded Pyrex and ran it through their own
example. The code looks quite messy, and I even saw a
few "goto"s.

looked at the assembler output from your C compiler lately?

</F>
LOL! - is it even possible to code an if else without conditional jumps?

- Hendrik

Nov 2 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Martin Mrazek | last post by:
Hi, I check data validity in html form by JS. Something like for (i=0; i<document.form.elements.length; i++) { chechkValidity(i); } Unfortunately, the form has about two thousands elements...
3
by: SpamProof | last post by:
I got an animated gif that is a barber pole spinning that I want to use as a progress bar. The problem is that is stops spinning (shows 1 frame) when my browser is processing a submited request...
3
by: Brian Henry | last post by:
Is there any way to get the status of a report being generated by the crystal reports viewer control? I have a report that takes up to 10 minutes to run and it looks like it's just jamed while this...
2
by: Arnold | last post by:
Greetings Gurus, In a report showing the names of students and their progress, I am getting an error in the name field (Name: #Error). The report gets its data from an unbound form containing...
0
by: Arnold | last post by:
Hi Everyone; In a report, I've essentially recreated a paper sheet by adding various labels--name, date, problem, year, Progress Notes, etc.--and horizontal lines (people have traditionally...
9
by: paul.jameson | last post by:
I have a simple Access database that stores Karaoke Songlists for my local pub. From this you are able to print out the song lists they use. Up until now, any duplicate songs that appear on say,...
1
by: gregoryenelson | last post by:
Hi all. I have created a Report with a graph also on it. The users, working through a form only (not the DB window) will want to view that Report run numbers of times against different criteria,...
0
by: Bill | last post by:
Hello All, I would like to know if it is possible to display a progress bar (I have a progress bar control) when a crystal report is being formatted prior to being displayed to screen? Is...
15
by: eladla | last post by:
Hi! I am creating a composite control the does some of it`s own data access. I want to display a progress bar between the time the page is loaded and the control place holder is displayed and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.