Sometimes when you start a program from another directory, or call a subprogram, the working directory mat not be what you thing it is.
This can be a problem is you assume it starts with the python file directory.
You can assure a starting location with the following snippet:
path as argument to os.path.abspath(relative_path) (of course replacing relative path with something like 'images/Background.gif.xcf')
This can be a problem is you assume it starts with the python file directory.
You can assure a starting location with the following snippet:
import os path = os.path.dirname(__file__) os.chdir(path)you can then get the absolute path to your 'Background.gif.xcf' (is that really the file name?) file by using a relative
path as argument to os.path.abspath(relative_path) (of course replacing relative path with something like 'images/Background.gif.xcf')