Sat Mar 28, 2020 10:51 am
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
Sat Mar 28, 2020 3:15 pm
Sat Mar 28, 2020 5:45 pm
dinasset wrote:self solution?
it seems that I have to enter
with open(i_dir+filename,"r") as f:
i.e. repeating the full path
quite surprising for an ignorant like me, but if this is the solution, OK...
import glob
files=glob.glob(os.path.join(dir ,'*.txt'))
Sat Mar 28, 2020 11:47 pm