This question was answered there 12 years ago. I was using the code from ccanonc
with open("outputfilepath", 'w') as > fp:
> for line in iterable: #assuming line is str with \n
> print >> fp, line
> #implicit fp.close() here as "with" scope endsto
today with python 3 and sage 9.5, I get: NameError: name 'iterable' is not defined
What is the easiest way to update this code?