File IOError: [Errno 19] No such device

I am trying to write a simple class that loads and saves objects to and from a file.

When I try to run this code:

file = open(“/FS/WEB/python/AppSettings.txt”, “w”)

File Operations here


I get this error on the open() call:

IOError: [Errno 19] No such device: ‘FS/WEB/python/AppSettings.txt’

I tried manually creating AppSettings.txt and I tried adding a leading slash to the file path but neither helped. Are you not allowed to read/write files in the python directory or am I doing something wrong?


WEB/python is the path to that directory.

file = open(“WEB/python/AppSettings.txt”, “w”)

The above should work for you.


Thanks, that fixed it. I had a feeling I was doing something stupid!