(path)
| 61 | |
| 62 | |
| 63 | def clear_path(path): |
| 64 | if os.path.isdir(path): |
| 65 | contents = os.listdir(path) |
| 66 | for file_name in contents: |
| 67 | file_path = os.path.join(path, file_name) |
| 68 | if os.path.isfile(file_path): |
| 69 | os.remove(file_path) |
| 70 | else: |
| 71 | shutil.rmtree(file_path) |
| 72 | |
| 73 | |
| 74 | def silent_call(cmd, raise_error=False, error_msg=''): |