What would be the best way to have 'file' returned as a string to be read into shell.Run()?
for dirpath, subdirs, files in os.walk(SOMEDIR):
for ext in files:
if ext.endswith(".txt"):
file = str(os.path.join(dirpath, ext))
shell = win32com.client.Dispatch('WScript.Shell')
os.chdir(PROGDIR)
shell.Run(PROG + file)
The issue I'm having is 'file' is not in a format that shell.Run() can read because there is a space in the dirpath. i.e. (Z:\Some Directory\etc\etc). Renaming the directory is not an option.