Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ofn-preset-guides
#31
(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\)
Reply
#32
No "testfile.dat" there neither.
Reply
#33
Is there a testfile.dat anywhere on your system?
Reply
#34
No, there isn't.
Reply
#35
[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'
➤>
Reply
#36
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.
Reply
#37
I will!
Thank you.
Reply
#38
Updated on SourceForge. Tell me how it goes.
Reply
#39
Sorry but it doesn't work.
Reply
#40
Please see your PM.
Reply


Forum Jump: