Matt's answer is the right one for older Pythons and Kevin's the right answer for newer ones.
If you wish not to copy the function for silentremove
, this functionality is exposed in path.py as remove_p:
from path import Path
Path(filename).remove_p()