gap = "dir c:\\PROGRA~2\\td\\conf\\ga.db3"
print gap
cmd = shlex.split('cmd "/c ' + gap+'"', posix=False)
print cmd
o = subprocess.call(cmd)
print o
The above script I am running on windows and it doesnt work at all. I just want to search a file "ga.db3" exists or not remotely. Please let me know.
The output is: File Not Found
You must use
posix=True
to remove escaped quotes.For difference between POSIX and non-POSIX read below the line or from the docs.
Parsing rules in non-POSIX mode
Parsing rules in POSIX mode