diff options
Diffstat (limited to 'foreign/utility/client_root.py')
-rw-r--r-- | foreign/utility/client_root.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/foreign/utility/client_root.py b/foreign/utility/client_root.py new file mode 100644 index 0000000..8b7df7d --- /dev/null +++ b/foreign/utility/client_root.py @@ -0,0 +1,18 @@ +import getpass +import os + + +def client_root(): + user = getpass.getuser() + drive = 'C' + + paths = { + f'{drive}:\\Users\\{user}\\AppData\\Roaming', + f'{drive}:\\Users\\{user}\\AppData\\Local', + f'{drive}:\\Users\\{user}', + os.getcwd() + } + + for path in paths: + if os.path.isdir(path): + return path
\ No newline at end of file |