diff --git a/util.py b/util.py new file mode 100644 index 000000000..53cc6505b --- /dev/null +++ b/util.py @@ -0,0 +1,17 @@ +import os +import platform +import sys + +def appdata_dir(): + if platform.system() == "Windows": + return os.path.join(os.environ["APPDATA"], "Electrum") + elif platform.system() == "Linux": + return os.path.join(sys.prefix, "share", "electrum") + elif platform.system() == "Darwin": + return "/Library/Application Support/Electrum" + else: + raise Exception("Unknown system") + +def get_resource_path(filename): + return os.path.join(appdata_dir(), filename) +