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

Support DOS/Windows Newlines

Posted by Stu on Sep 07, 2009

Hi,
I've been trying some sketches to test compatibility of shoebot and nodebox... if I import from shoebot from windows I get double newlines.


 
Posted by Stfan on Sep 07, 2009

Normally the PyQt version of NodeBox should run decently within Windows. I don't think it has problems with line endings. Unfortunately I don't have a Windows box at hand so I can't test this for you.

Not sure about Shoebot though, perhaps you should ask the Shoebot people.

Stefan



Posted by anonymous on Sep 08, 2009

In Python, that can be fixed with a 'U' flag in the open function.

f = open("C:\some\windows\file.txt", 'rU')



Posted by Tom De Smedt on Sep 08, 2009

I believe Stu is referring to the fact that lines in Windows files are separated with newline + carriage return while OS X and Unix simply use newline. Apparently the carriage return isn't stripped in the nodebox editor so you get double lines.

We can fix that. I'll add it to the to-do for next release.