Gimp-Forum.net

Full Version: ofn-preset-guides
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
(07-01-2021, 04:33 AM)EdoNork Wrote: [ -> ]Sorry for the mistake.

Here you have again:

GIMP 2.10.24 Python Console
Python 2.7.18 (default, Apr 20 2020, 16:57:11)  [GCC 9.3.0 64 bit (AMD64)]
➤> import os.path
➤> fname=os.path.join(gimp.directory,'testfile.dat')
➤> print fname
C:\Users\Iñigo\AppData\Roaming\GIMP\2.10\testfile.dat
➤> with open(fname,'w') as dat:
...     dat.write('Test successful')
...

Nothing is written in the plugins folder..

The result file is not expected in the plug-ins folder but in that folder's parent (C:\Users\Iñigo\AppData\Roaming\GIMP\2.10\)
No "testfile.dat" there neither.
Is there a testfile.dat anywhere on your system?
No, there isn't.
[ofnuts here]

OK, got hold of a Windows system. I do get an error:

Code:
➤> import os.path
➤> fname=os.path.join(gimp.directory,'testfile.dat')
➤> print fname
C:/Users/XXXX/NiñoDéjàVu/GIMP/2.10/testfile.dat
➤> with open(fname,'w') as dat:
...     dat.write('Test successful')
...
Traceback (most recent call last):
  File "<input>", line 1, in <module>
IOError: [Errno 2] No such file or directory: 'C:/Users/XXXX/Ni\xc3\xb1oD\xc3\xa9j\xc3\xa0Vu/GIMP/2.10/testfile.dat'
➤>
OK, figured out the problem. I know how to fix it for Windows, but I have to check that the fix won't break other platforms. Stay tuned.
I will!
Thank you.
Updated on SourceForge. Tell me how it goes.
Sorry but it doesn't work.
Please see your PM.
Pages: 1 2 3 4