2006-08-13, 05:08
Hi,
I am trying to open a text file using the following script, however it always returns IOError and I am very sure that the file that I intend to open is in the specified path :-
def SaveFile(data):
dialogProgress.create("File Dialog…", "\nOpening file")
try:
f = open("Q:\scripts\workfile.html")
except IOError:
dialogProgress.close()
xbmcgui.Dialog().ok('Error','\nCannot open file!')
else:
f.close()
dialogProgress.close()
return "true"
xbmcgui.Dialog().ok('closing file','\nDone!')
dialogProgress.close()
return "true"
Please help. Thanks!!
I am trying to open a text file using the following script, however it always returns IOError and I am very sure that the file that I intend to open is in the specified path :-
def SaveFile(data):
dialogProgress.create("File Dialog…", "\nOpening file")
try:
f = open("Q:\scripts\workfile.html")
except IOError:
dialogProgress.close()
xbmcgui.Dialog().ok('Error','\nCannot open file!')
else:
f.close()
dialogProgress.close()
return "true"
xbmcgui.Dialog().ok('closing file','\nDone!')
dialogProgress.close()
return "true"
Please help. Thanks!!