Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print is not real-time #6

Closed
Almenon opened this issue Jan 17, 2018 · 1 comment
Closed

print is not real-time #6

Almenon opened this issue Jan 17, 2018 · 1 comment
Labels

Comments

@Almenon
Copy link
Owner

Almenon commented Jan 17, 2018

from time import sleep
from datetime import datetime

x=0

while(x<2):
    x = x+1
    sleep(2)
    print(datetime.now())    
      

prints should come in with a gap of 2 seconds but instead they come in all at once at the end

@Almenon Almenon added the bug label Jan 17, 2018
@Almenon
Copy link
Owner Author

Almenon commented Jan 22, 2018

i found the answer in extrabacon/python-shell#103

I need to use -u to disable buffering of output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant