Delete file or directory
(path)
| 48 | |
| 49 | |
| 50 | def clean(path): |
| 51 | """Delete file or directory""" |
| 52 | if not os.path.exists(path): |
| 53 | return |
| 54 | if os.path.islink(path): |
| 55 | os.remove(path) |
| 56 | elif os.path.isdir(path): |
| 57 | shutil.rmtree(path) |
| 58 | else: |
| 59 | os.remove(path) |
| 60 | |
| 61 | |
| 62 | def get_string(length): |