On 3/25/12 10:39 PM, Dima Pasechnik wrote:
wow, *deleting* does this?! I duly sought close() method for output, didn't find it...
I wouldn't use the del method, even if it may work, just because it looks so odd compared to usual file paradigms.
Searching for "cvs writer python empty file" on the net gives lots of hits talking about this problem, and the main conclusion seems to be that you need to close the file (or even better, use 'with' so the file is automatically closed).
http://stackoverflow.com/questions/3976711/csvwriter-not-saving-data-to-file-why
Another question is why this is not needed at sage prompt. Different behaviour in shell and in nb is never good, IMHO.
When you exit Sage (to look at the file), the files are automatically closed (IIRC). In the notebook, the Sage session keeps running for the next cell, so the difference seems to be natural.
Jason -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org