Skip to content

Flushing stoud in Spyder #2860

@johnhcc

Description

@johnhcc

Perhaps this is not an 'issue' (maybe it's even 'desired behavior'), but then again maybe it is.

If I have a simple program

import time
print "start"
time.sleep(3)
print "done"

and run it in Spyder, I get a three second delay, and then see "start" and "done" printed virtually simultaneously.

However if I run this program in iPython directly (outside of Spyder), or using python from the command line, I see "start", a three second delay, and then "done". For me, at least, this is the desired behavior.

I'm aware I can force the issue in Spyder using import sys; sys.stdout.flush() after the print. However, without modifying my programs to insert the flush command, is there a way to get this same behavior in Spyder?

For what it's worth, calling python -u should do the same thing (but I'm not sure that helps here...)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions