Get user's home directory
()
| 121 | |
| 122 | |
| 123 | def get_home_path(): |
| 124 | """Get user's home directory""" |
| 125 | |
| 126 | if python_version() >= "3.5": |
| 127 | from pathlib import Path |
| 128 | |
| 129 | home_dir = str(Path.home()) # this method returns slash as dir sep* |
| 130 | else: |
| 131 | home_dir = expanduser("~") |
| 132 | |
| 133 | home_dir = slashen(home_dir) |
| 134 | home_dir = remove_last_slash(home_dir) |
| 135 | |
| 136 | return home_dir |
| 137 | |
| 138 | |
| 139 | def slashen(path, direction="forward"): |
no test coverage detected