From: Glen Holcomb Date: 2008-07-16T06:17:23+09:00 Subject: Re: Immediately print a string on stdout without new line? ------=_Part_11424_4152437.1216156925327 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tue, Jul 15, 2008 at 3:09 PM, Janus Bor wrote: > Hi everyone! > > I'm trying to do something like this: > > print "Processing... " > > #some fancy code that takes ages, or maybe: > sleep(3) > > print "done\n" > > > I was expecting to get the following output on my console: > > Processing... [and after 3 secs:]done > > However, the script first waits 3 seconds and then writes the whole line > at once. If I change the first line to > > print "Processing...\n" > > everything works as expected. But that's not really what I want. Is > there another way of doing this? > > Thanks, Janus > -- > Posted via http://www.ruby-forum.com/. > > Janus this works for me: def processing print "Processing... " sleep(3) print "done!" end processing -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) ------=_Part_11424_4152437.1216156925327--