1. NodeBox 1
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Documentation
  4. Forum
  5. Blog

oddity with sys module?

Posted by Seanth on Jul 11, 2008

While working to get some older code working in NodeBox, I ran into some problems with sys.
>> import sys
>>> sys.stdout.flush()
>>>

In NodeBox:
import sys
sys.stdout.flush()
Traceback (most recent call last):
File "nodebox/gui/mac/__init__.pyo", line 358, in _execScript
File "", line 2, in
AttributeError: 'OutputFile' object has no attribute 'flush'


 
Posted by anonymous on Jul 14, 2008

That's because the text field is not your everyday stdout. It can't be flushed during the program, though a

print
line might do the trick. Unfortunately, NB hangs until the program is finished running, so flushing is useless anyway.