H
hokiegal99
This code:
import os, re, string
setpath = raw_input("Enter the path: ")
for root, dirs, files in os.walk(setpath):
id = re.compile('Microsoft Excel Worksheet')
fname = files
# print fname
content = open(fname[1],'rb')
Produces this error:
IOError: Error[2] No such file or directory 'Name of File'
The strange thing is that it correctly identifies the file that it says
doesn't exist. Could someone explain why this is?
Also, is "files" a nested list? It looks like one, but I'm not entirely
sure as I'm still relatively new to Python. Thanks!
import os, re, string
setpath = raw_input("Enter the path: ")
for root, dirs, files in os.walk(setpath):
id = re.compile('Microsoft Excel Worksheet')
fname = files
# print fname
content = open(fname[1],'rb')
Produces this error:
IOError: Error[2] No such file or directory 'Name of File'
The strange thing is that it correctly identifies the file that it says
doesn't exist. Could someone explain why this is?
Also, is "files" a nested list? It looks like one, but I'm not entirely
sure as I'm still relatively new to Python. Thanks!