On 23/05/2015 06:56, Jim Mooney Py3.4.3winXP wrote:
'''I was using with open...:, but I'm printing a header in one function,
calling a looping
function to print detail lines, then returning to the calling function to
print
the footer. But that didn't work since the with statement only seems to wo
On 23/05/15 06:56, Jim Mooney Py3.4.3winXP wrote:
'''I was using with open...:, but I'm printing a header in one function,
calling a looping
function to print detail lines, then returning to the calling function to
print
the footer. But that didn't work since the with statement only seems to work
Jim Mooney Py3.4.3winXP wrote:
> function. Is there
> a way around this, other than passing the file as I have here? Also, is it
> a good idea to pass a file handle like that or is there a better way?
Not necessarily better, but instead of passing around the file you can
rewrite your code to use