I have this code in Python which runs perfectly well. What it does is it deletes files from a list on a filesheet. Now my question is if the cmd returns file not found could not delete how can I make Python aware of it so that I could put in a log the files I haven’t deleted? I thought error handling would help but it wasn’t an error in part of Python since I was just invoking the cmd through Python. Any ideas are welcome. 🙂
Example of how I invoke the cmd:
import os
os.system('CLS()')
From the docs:
“The subprocess module allows you to spawn new processes, connect to their input/output/error pipes, and obtain their return codes.”
http://docs.python.org/library/subprocess.html