Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Tracking the status of python script execution

Thread Tools

Re: Tracking the status of python script execution

Ned Batchelder
Posts: n/a
On 12/11/13 2:26 PM, Shyam Parimal Katti wrote:
> Hello All,
> I am looking for a library that can help me trace the status of a live
> python script execution. i.e if I have a python script `` with 200
> lines, when I execute the script with `python`, is there a way to
> trace the status of this execution in terms of number of lines executed
> so far?
> Background: We have a Web page with "Run" button that executes the
> program `` when a user clicks it. We were looking of a way to keep
> the user informed about the status of run by using: (no. of lines
> executed/total lines) *100. Since the script `` is running multiple
> sql queries, it usually won't be the case that the script would complete
> within few seconds of its execution.

Using sys.settrace, you could write a tool to track the lines being
executed in any Python program. But your problem is different than that
in two ways:

1) You don't need to track any Python program, you need to track your
particular Python program.

2) You want the output to take into account the "total number of lines",
which means you have to somehow configure it ahead of time.

Both of these factors point to using a more specialized approach, by way
of modifying your program. I like Chris' idea of simply tracking the
progress of the SQL queries since they are taking the time.

Ned Batchelder,

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Tracking the status of python script execution Chris Angelico Python 0 12-11-2013 07:34 PM
Tracking the status of python script execution Shyam Parimal Katti Python 0 12-11-2013 07:26 PM
The node.js Community is Quietly Changing the Face of Open Source Rodrick Brown Python 2 04-17-2013 04:47 PM
Is there a difference between the use of the word montage vscollage Danny D. Digital Photography 8 04-15-2013 02:24 PM
Windows 8 - so bad it's hastening the death of the PC? ~misfit~ NZ Computing 18 04-15-2013 04:15 AM