Hi, I'm trying to use glob to read a file of which I don't know the complete name (but only some parts).
fiLUMOname = 'Lsum_' + period + '_' + parts[2] + '_' + parts[3] + '_' + parts[4] + '_*.dat' aaa = glob.glob(fiLUMOname) print(aaa) fiLUMO = open(aaa[0], 'r') where period, and the elements of parts are strings. but aaa results empty. (and so it cannot open the file) The file exist and I'm able to recover it if I write by hand inside glob.glob() the name between " " with the * where I don't know the name. How can I pass my string to glob.glob inside " "? Is there a simpler method to obtain the same result? thanks Gabriele
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor