SKK,
This is because python is running without tty and thus buffers it's stdout. Probably I can't develop real terminal emulator for kobo because it has limited kernel (without pseudo terminal support)
For now the only solution I have is to put these lines at the beginning of your script:
class Unbuffered(object):
def __init__(self, stream):
self.stream = stream
def write(self, data):
self.stream.write(data)
self.stream.flush()
def writelines(self, datas):
self.stream.writelines(datas)
self.stream.flush()
def __getattr__(self, attr):
return getattr(self.stream, attr)
import sys
sys.stdout = Unbuffered(sys.stdout)
|