GIMP Version: 2.10.18 samj
Operating System: Windows
GIMP Experience: Moderate
I have a bit of experience in writing plug-ins in python for image manipulation, but
none in browsing text files from the plug-in.
I prepared a folder on my desktop called MyPresets.
I wrote a test filter with the following instructions (copied somewhere on the net)
def LoadPresets (inFolder) :
home = expanduser("~")
i_dir = home+inFolder
gimp.message (str(i_dir))
# Read every file in directory
for filename in os.listdir(i_dir):
gimp.message (str(filename))
#with open(filename, "r") as f:
with open(filename,"r") as f: ### DOES NOT FIND IT ?????
# Read each line of the file
for line in f.readlines():
gimp.message (line.split())
return
The inFolder field contains "\Desktop\MyPresets"
I got the messages I wrote for tracing but then I got the error as shown:
Attachment:
Cattura.PNG [ 36.43 KiB | Viewed 2233 times ]
Why the file is not found?
Sorry for my ignorance in that type of instructions.
Any help?