Re: print to console without a line break

2008-12-23 Thread Qian Xu
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

Re: print to console without a line break

2008-12-23 Thread Qian Xu
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/

Re: print to console without a line break

2008-12-23 Thread Albert Hopkins
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

Re: print to console without a line break

2008-12-23 Thread Lie Ryan
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

Re: print to console without a line break

2008-12-23 Thread Qian Xu
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

print to console without a line break

2008-12-23 Thread Qian Xu
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