Lie Ryan wrote:
> If you don't mind an extra space, you can use this:
>
> print 'Testing something ...',
> # note the trailing comma
Thanks. However, the contents will be saved in buffer and will not be shown
until print "(last piece)"
sys.stdout.flush() can solve this problem :-)
--
http://ma
Albert Hopkins wrote:
> On Tue, 2008-12-23 at 13:18 +, Lie Ryan wrote:
>
> Probably because your stdout is line-buffered. Try:
>
> sys.stdout.write("Testing something...")
> sys.stout.flush() # flush the stdout buffer
Thanks. This works for me ^^)
--
http://mail.python.org/mailman/listinfo/
On Tue, 2008-12-23 at 13:18 +, Lie Ryan wrote:
> On Tue, 23 Dec 2008 11:50:59 +0100, Qian Xu wrote:
>
> > Hello All,
> >
> > Is it possible to print something to console without a line break?
> >
> > I tried:
> > sys.stdout.write("Testing something ...") // nothing will be printed
> > ti
On Tue, 23 Dec 2008 11:50:59 +0100, Qian Xu wrote:
> Hello All,
>
> Is it possible to print something to console without a line break?
>
> I tried:
> sys.stdout.write("Testing something ...") // nothing will be printed
> time.sleep(1)
> sys.stdout.write("done\n") // now, the whole string w
Qian Xu wrote:
> Hello All,
>
> Is it possible to print something to console without a line break?
>
> I tried:
> sys.stdout.write("Testing something ...") // nothing will be printed
> time.sleep(1)
> sys.stdout.write("done\n") // now, the whole string will be printed
>
> What I want, is
Hello All,
Is it possible to print something to console without a line break?
I tried:
sys.stdout.write("Testing something ...") // nothing will be printed
time.sleep(1)
sys.stdout.write("done\n") // now, the whole string will be printed
What I want, is to see "Testing something ..." first