I just want to get a way to open and close any particular folder through python code in windows 7 and above, Any Suggestion will be a great help. Thank you.
this is to open the directory
task = subprocess.Popen('explorer "C:\\', shell=True)
p = task.pid
this is to close through the PID
os.popen('TASKKILL /PID ' + str(p) + ' /F')
The problem is with the closing code it gives me and error:
ERROR:The proces "i.e 12086" not found.