Posts: 9
Threads: 0
Joined: Jun 2021
Reputation:
0
Operating system(s):
- Windows Vista or 7, 8, 10 (64-bit)
Gimp version: 2.10
Hi.
Just tried.
It works in one of my systems, but not in the other. The difference is that the second one has an "ñ" in the GIMP data path.
Posts: 6,343
Threads: 274
Joined: Oct 2016
Reputation:
564
Operating system(s):
Gimp version: 2.10
Can Gimp write in that directory? The script creates a .log file when it registers (so you can track problem). So have you got an ofn-preset-guides.log file there and if so what are the contents (and have you got one in the version that works)?
Posts: 7,133
Threads: 155
Joined: Oct 2016
Reputation:
1,004
Operating system(s):
Gimp version: 2.10
Just wondering why some scripts start
# -*- coding: iso-8859-15 -*-
and others
# -*- coding: utf-8 -*-
I know one is for character sets and the other unicode but how is the choice made and why some scripts (not yours) just leave that line out ?
Posts: 6,343
Threads: 274
Joined: Oct 2016
Reputation:
564
Operating system(s):
Gimp version: 2.10
In my scripts, depends which previous one I use to get started with the boiler plate. I tend to favor unicode, but still have a few ISO-8859 ones left.
If there is nothing, it can work if your script is using only plain ASCII, or the default encoding defined for the system/user where it's running.
In the case at hand, the ñ comes from data, not the code...
Posts: 9
Threads: 0
Joined: Jun 2021
Reputation:
0
Operating system(s):
- Windows Vista or 7, 8, 10 (64-bit)
Gimp version: 2.10
import os.path
File "<input>", line 1
rt os.path
^
SyntaxError: invalid syntax
➤> fname=os.path.join(gimp.directory,'testfile.dat')
Traceback (most recent call last):
File "<input>", line 1, in <module>
NameError: name 'os' is not defined
➤> print fname
Traceback (most recent call last):
File "<input>", line 1, in <module>
NameError: name 'fname' is not defined
➤> with open(fname,'w') as dat:
... dat.write('Test successful')
Posts: 9
Threads: 0
Joined: Jun 2021
Reputation:
0
Operating system(s):
- Windows Vista or 7, 8, 10 (64-bit)
Gimp version: 2.10
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..