Python (1.5.2) Can't find file in IIS
ragthorn
zlbdaw*** at ***zoo.upe.ac.za
Mon Nov 20 04:32:33 EST 2000
Hi,
After having way too much trouble getting an ASP script to work, I
wrote a simple hit counter in Python:
###### Begin Code ##########
#Default ZSSA counter front page
import string
print "Content-Type: text/html\n\n"
fileRead = open('zssa_count.txt', 'r')
intHits = string.strip(fileRead.read())
if intHits == '':
intHits = 0
fileRead.close()
intHits = string.atoi(intHits) + 1
fileWrite = open('zssa_count.txt', 'w')
fileWrite.write(str(intHits))
fileWrite.close
# Snipped HTML output
###### End Code ############
It works without a hitch at home (win9x) and on my workstation (NTW),
but as soon as I stick it live on NTServer I get this error:
###### Begin error text #########
Traceback (innermost last): File "<file_path>\z.default.py", line 7,
in ? fileRead = open('zssa_count.txt', 'r') IOError: [Errno 2] No such
file or directory: 'zssa_count.txt'
###### End error text ##########
where <file_path> is the internal (local) path to the file, and it
_is_ there, I'm looking at it right now in explorer.
Any help will be really appreciated.
Cheers.
More information about the Python-list
mailing list