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 120261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:47:00+00:00 2026-05-11T03:47:00+00:00

Objective : Make a progress bar where users can check how much of a

  • 0

Objective: Make a progress bar where users can check how much of a file has been downloaded by my server.

Scenario:I have a PHP script that executes a python script via popen. I have done this like so:

$handle = popen('python last', 'r');  $read = fread($handle, 4096);  pclose($handle); 

This python script outputs to the shell something like this:

[last] ZVZX-W3vo9I: Downloading video webpage [last] ZVZX-W3vo9I: Extracting video information [download] Destination: myvideo.flv [download]   9.9% of 10.09M at    3.30M/s ETA 00:02 

Problem:When I read in the file generated by the shell output I get all the shell output except the last line!? WHY?

Just to add, when I run the command via the shell, the shell cursor appears at the end of that line and waits till the script is done.

Thanks all

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T03:47:00+00:00Added an answer on May 11, 2026 at 3:47 am

    First thing that comes into my mind: maybe the program detects that it is not executed on a TTY and therefore does not show the last line, which probably involves ugly control characters because that line seems to update itself?

    What happens when you redirect the output to a file (in the shell), or pipe it through less? If you don’t see the last line there, this is likely to be the case. I don’t know of another solution than to fix the source.

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

Sidebar

Ask A Question

Stats

  • Questions 103k
  • Answers 103k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The circular reference is likely due to DataTable having a… May 11, 2026 at 8:28 pm
  • Editorial Team
    Editorial Team added an answer 1: Instead of registering an event for every arrow separately… May 11, 2026 at 8:28 pm
  • Editorial Team
    Editorial Team added an answer It seems like you implemented your own list() function. Its… May 11, 2026 at 8:28 pm

Related Questions

Im trying to get into some basic JavaFX game development and I'm getting confused
How can I make a phone call in Objective-C?
In Objective-C 2.0, is it possible to make a method where the argument is
When creating a setup/MSI with Visual Studio is it possible to make a setup

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.