Quote:
Originally Posted by sergeyvl12
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)
|
Thanks for your help! I added that code but now it says unbuffered object has no attribute write. So I guess I will just have to give up for now on getting python programs to run on a kobo.
Edit: Actually I made a mistake in the spacing on the code. It doesn't give that error anymore when I test it on the computer. Now to test it on the kobo.