Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9137391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:05:52+00:00 2026-06-17T09:05:52+00:00

I am delivering a video item to iTunes. When I run the command I

  • 0

I am delivering a video item to iTunes. When I run the command I get an output similar to:

$ command
[2013-01-09 11:02:14 PST] <main> DBG-X:   1% 
[2013-01-09 11:02:15 PST] <main> DBG-X:   2% 
[2013-01-09 11:02:16 PST] <main> DBG-X:   3%
...etc...

How would I go about updating a database field in my application to show the progress of this delivery? I imagine I would re-direct to a log file using something like stdout=subprocess.PIPE, stderr=subprocess.PIPE.

But how would I get this in real time to update the db?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:05:53+00:00Added an answer on June 17, 2026 at 9:05 am

    I would do this (there are probably other, better ways):

    1. Check the file every n seconds and remember the last line in that file.
    2. If the last line has changed, it means that some progress has been made since the last time you checked it.
    3. Once you’ve detected such progress, you should be able to trigger the function that writes to your database.

    Note that this is only almost real-time, as you only check the file every n seconds

    Code:

    progress = 0
    lastLine = ''
    n = 5 # seconds
    while progress < 100:
        with open('path/to/logfile') as logfile:
            for newLine in logfile:
                pass
            if newLine.strip() != lastLine:
                lastLine = newLine.strip()
                writeToDatabase(lastLine)
        time.sleep(n)
    

    Hope this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When trying to publish-local in sbt, I get the following output: [info] :: delivering
I would like to remove all HTML comments from my facelets before delivering to
Please describe some of the best practices for delivering video over the web through
I would like to grab an existing stream from an IP-Camera delivering h264 encoded
Why do i get this error: 12-27 20:37:57.039: E/AndroidRuntime(3798): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null,
04-25 14:16:30.931: E/AndroidRuntime(6638): FATAL EXCEPTION: main 04-25 14:16:30.931: E/AndroidRuntime(6638): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null,
I have some script that is delivering a series of rows from an SQL
There are many services available for delivering content to users. I am looking for
What are the best practices for delivering an Adobe Air app that needs a
i am facing a problem of delivering email to hotmail inbox. my email is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.