0

locfile = ['fileone','filetwo','filetthree']

myfile = open('locfile','rU')

as you can see open file object expects a string with a file extension as well. I simply want to pass file names in as i process the list one file name at a time. How can I do that?

1 Answers1

0

Looping over a list in Python

locfile = ['fileone','filetwo','filetthree']
for x in locfile:
    file = openfile(x,'rU')
Community
  • 1
  • 1
user3704258
  • 1
  • 1
  • 2