Writing to text file from metadata agent

Fails
I'm trying to write a metadata agent that will output errors to a text file.

This is what I have come up with:


<br />
f = open('~/Desktop/error.txt', 'a')<br />
f.write("Error text")<br />
f.close()




It fails, however, with a Console message that goes something like "global name "open" is not defined" (in agentkit.py).

Any help is appreciated :)

try without the ‘a’

or use a+

TGhey may have disabled it. In the xbmcnfo importer,


nfoText = Core.storage.load(nfoFile)

is used to open a file for read in.

Thanks, Harley - I’ll try your suggestions :wink:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.