Hi All,

I have a list of scripts which are present in various folders and this may be 
present in one of their sub-folder too.
There are 1000s of folders and hence parsing through each folder/sub-folder is 
not an option.

So I was trying to dir /s /b using python.
Now since the file's path name is computed using other part of the code, I am 
feeding in a variable here and somehow it does not seem to work.. :(

Intent is to run following command from python 
dir /s /b "c:/abc/def/ghjmain\features\XYZ\*<filename>"

My present code.
import subprocess

for row in range(1,max_row):
        tempID_cell = "C" + str(row);
        tempID = ws[tempID_cell].value;
        print (tempID);
        Command = "c:\\abc\\def\\ghj\\main\\features\\XYZ\\*" + str(tempID) + 
".cli";
        print (Command);
        IsPresent = subprocess.check_output("dir /s /b Command", shell=True);

Any help would really be appreciated.

Regards,
Siddharth
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to