I run python scripts from R using the R command:
system('python test.py')
But my print statements in test.py do not appear in the R console until the python program is finished. I would like to view the print statements as the python program is running inside R. I have also tried sys.stdout.write(), but the result is the same. Any help is greatly appreciated.
Here is my code for test.py:
import time
for i in range(10):
print 'i=',i
time.sleep(5)

flush.console(), but of course that doesn't help here.