Really, really annoying problem

Brett Lempereur a.lempereur
Wed Sep 20 16:16:33 EDT 2000


> - how do you read in the filename?

The filename is taken from the "sys.argv[0]" property, that's why I need the
function in the first place.  The directory for the configuration files will
either be "lib/config/" or "config/" with "lib" being the directory the code
is placed in.

> - how do you know that the backslashes are doubled?
>   (in other words, how did you print the filename?)

Because I do this:

filename = tools.addroot("ppdump.cfg")
file = open(filename, "w")

The error occurs at the "open(filename, 'w')" stage, where it raises the
double backslash error

The error message from python is....

Traceback (most recent call last):
  File "D:\Python\Pythonwin\pywin\framework\scriptutils.py", line 301, in
RunScript
    exec codeObject in __main__.__dict__
  File "C:\My Documents\Python\Backup Program\Lib\recurse_test.py", line 17,
in ?
    out_file = open(out_filename)
IOError: [Errno 2] No such file or directory: 'C:\\ppdump.txt'




More information about the Python-list mailing list