I cannot understand why this doesn't do as I expect...
if (os.path.exists(ofile)):
os.unlink(ofile)
print "it existed, but I've deleted it!"
print "It didn't exist so I'm creating it"
---Here we have a subprocess command---
The print statements print as you'd expect but the command only runs if "ofile" doesn't already exist. i.e. the command won't run if the file has just been deleted by os.unlink.
Help appreciated.