ActiveState Community

raw_input does not show up

Posted by kartal on 2009-04-13 19:56

Hi

For some reason I cannot get the command output tab to show the strings from raw_input or input() command.

a=raw_input('hello: ')
print a

My version:

Komodo Edit, version 5.1.2, build 3457, platform win32-x86.
Built on Fri Apr 10 09:28:03 2009.

toddw | Tue, 2009-04-14 09:46

Since Komodo's command output window is not a real terminal, there are some quirks you'll notice with the io handling.

In this case, Python is buffering the output, so you don't see the "hello: " message until after the fact. To work around this, when invoking Python, add the unbuffered mode argument -u, example:

python -u -c "a = raw_input('hello: '); print a"

Cheers,
Todd