More generic solution with os.remove()