cannot write to file after close()
reinhold-birkenfeld-nospam at wolke7.net
Sun Sep 25 22:38:00 CEST 2005
Rainer Hubovsky wrote:
> Hello Python-Gurus,
> f = open(LOGFILE,'w')
> f.write(time + '\n')
> command = 'ping -n 20' + target + '>>' + LOGFILE
> produces an error saying that a file cannot be accessed because it is used
> by another process. I asume it is f which is used but don't understand why.
> Any ideas?
Is the above exactly your code? If yes, it should be
The parentheses are necessary to make the statement a function call.
More information about the Python-list