开发者

SciTE can't flush output pane until program exit

开发者 https://www.devze.com 2023-02-19 06:03 出处:网络
SciTE version is 2.25. I have some ruby code to test it. def foo puts \"hello\" sleep 5 puts \"world\" end puts foo

SciTE version is 2.25.

I have some ruby code to test it.

def foo
  puts "hello"
  sleep 5
  puts "world"
end

puts foo

SciTE's output pane will show this:

>ruby scite.rb

And 5 seconds later print:

hello
world

>Exit code: 0

It's not correct and I remember the previ开发者_高级运维ous version SciTE is right. Why?


Try putting STDOUT.sync = true at the beginning of your program. I'm neither a Windows nor SciTE user, but I know that some of our students at Rubylearning had similar problems and apparently that was the fix (or manual calls to flush after outputting something).

0

精彩评论

暂无评论...
验证码 换一张
取 消