Initialize getters for Chrome software and general ones; Fix some examples for chrome

This commit is contained in:
Timothyxxx
2023-12-29 22:24:45 +08:00
parent a4e8cfedb9
commit 86ce9e1497
7 changed files with 124 additions and 17 deletions

View File

@@ -0,0 +1,15 @@
import os
import platform
# todo: move to getter module
def get_desktop_path():
username = os.getlogin() # Get the current username
if platform.system() == "Windows":
return os.path.join("C:", "Users", username, "Desktop")
elif platform.system() == "Darwin": # macOS is identified as 'Darwin'
return os.path.join("/Users", username, "Desktop")
elif platform.system() == "Linux":
return os.path.join("/home", username, "Desktop")
else:
raise Exception("Unsupported operating system")