import os if os.path.exists(path_to_file): # Do stuff
Python
Check To See If a File Exists
Missing from Python: kill-able threads and popens with timeouts…
It would be nice to be able to kill threads anytime you wanted, there are solutions to this but are not part of the Python library and I didn’t yet get a chance to try them… Actually there is only one promising solution to this.
The other thing I would love to have in Python is to be able to call popen with a second parameter which is a timeout, That is (obviously) popen would give up and return if the call was taking more than x number of seconds…
I'm the co-founder of