10-10-2021, 06:15 PM
Still flogging a dead horse, in the hope is that I may yet learn something!
Background: I am using the GIMP 2.10.25 Appimage, extracted, thanks to Rich's help.
When I run my "new_template" from the terminal it works. When I add "workPath = os.getcwd()" it shows the working path as "/home/david/GIMP-2.10.21/squashfs-root".
Run directly from GIMP the working path is "/home/david" which is obviously incorrect. I can prove this by changing my "file open" to the full path and it then works correctly.
If I use "os.path.abspath("tmplt.py")" from GIMP it gives me a path of "/home/david/tmplt.py" which is also incorrect.
Whilst I can get it working, I would like to be able to code it so that it is machine/OS independant, but also understand why the problem occurs.
One of the difficulties, when scouring the internet, is that much of the Python information is not clear as to what version it refers.
Background: I am using the GIMP 2.10.25 Appimage, extracted, thanks to Rich's help.
When I run my "new_template" from the terminal it works. When I add "workPath = os.getcwd()" it shows the working path as "/home/david/GIMP-2.10.21/squashfs-root".
Run directly from GIMP the working path is "/home/david" which is obviously incorrect. I can prove this by changing my "file open" to the full path and it then works correctly.
If I use "os.path.abspath("tmplt.py")" from GIMP it gives me a path of "/home/david/tmplt.py" which is also incorrect.
Whilst I can get it working, I would like to be able to code it so that it is machine/OS independant, but also understand why the problem occurs.
One of the difficulties, when scouring the internet, is that much of the Python information is not clear as to what version it refers.