Hello,
When reading a large datafile, I want to print a '.' to show the
progress. This fails, I get the series of '.'s after the data has been
read. Is there a trick to fix this?
Thanks 5 2219
"JD" <jd@something.com> wrote: When reading a large datafile, I want to print a '.' to show the progress. This fails, I get the series of '.'s after the data has been read. Is there a trick to fix this?
assuming that you're printing to stdout,
sys.stdout.flush()
should do the trick.
</F>
On 2005-11-11, Fredrik Lundh <fr*****@pythonware.com> wrote: "JD" <jd@something.com> wrote:
When reading a large datafile, I want to print a '.' to show the progress. This fails, I get the series of '.'s after the data has been read. Is there a trick to fix this?
assuming that you're printing to stdout,
sys.stdout.flush()
should do the trick.
It does,
Thanks!
jd> When reading a large datafile, I want to print a '.' to show the
jd> progress. This fails, I get the series of '.'s after the data has
jd> been read. Is there a trick to fix this?
As Fredrik indicated, you need to flush the output buffer. You might also
want to check out the progress module available from my Python Bits page: http://orca.mojam.com/~skip/python/
Skip
This is something I wrote that might help. http://aspn.activestate.com/ASPN/Coo.../Recipe/299207
-Larry Bates
JD wrote: Hello,
When reading a large datafile, I want to print a '.' to show the progress. This fails, I get the series of '.'s after the data has been read. Is there a trick to fix this?
Thanks
On 2005-11-11, Larry Bates <la*********@websafe.com> wrote: This is something I wrote that might help.
http://aspn.activestate.com/ASPN/Coo.../Recipe/299207
The solutions become better and better.
Thanks.
-Larry Bates
JD wrote: Hello,
When reading a large datafile, I want to print a '.' to show the progress. This fails, I get the series of '.'s after the data has been read. Is there a trick to fix this?
Thanks This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Mark Evenson |
last post by:
A question about Output Buffering in PHP-CLI.
Is it expected that the following code will emit two representations of $x?
I would like to use print_r(), but capature its output in a String, to...
|
by: vishal |
last post by:
hi
vishal here. can anyone tell me that how to buffer output and then send
the output to client at a time.
what is my problem is that i have a php file which runs query on
database and takes...
|
by: Tim Mohler |
last post by:
All -
I have a script that provides a web page interface to various system
utilities. Once the user has selected the utility and input various
parameters, it calls itself with a different method...
|
by: Shahid Juma |
last post by:
Hi,
I was wondering if something similar to php (ob_get_contents(), output
buffering) exists in ASP/VBscript.
Thanks
Shahid
|
by: Fred Ma |
last post by:
Hello,
I posted previously under the thread:
How to break this up into streambuf/ostream
I've asked our library to get "C++ IOStreams and Locales..." by A.
Langer et al. Meantime, I've...
|
by: dawnerd |
last post by:
Hi, I am developing a CMS and came across something which has never
happened to me before, and I re-wrote the specific script twice, both
differently, and still had the same error.
I'm not sure...
|
by: jools |
last post by:
I'm having trouble modifying some code written by someone else.
The code is very dense and obscure but does work fine. However I need to
insert a block of my own and I've hit what I assume is a...
|
by: Grant Edwards |
last post by:
When I ssh in to my Windows XP box and run Python apps, output
from "print" and and "sys.stdout.write()" is being buffered so
that none of the output shows up until the program exits.
From...
|
by: Abubakar |
last post by:
Hi,
recently some C programmer told me that using fwrite/fopen functions
are not efficient because the output that they do to the file is
actually buffered and gets late in writing. Is that...
|
by: thedsadude |
last post by:
Hello,
I'm launching a script as follows:
<code>
p = subprocess.Popen()
p.wait()
</code>
If p.py writes to sys.stdout, then it is shown on the console.
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
| |