def get_st_installation_folder():
if platform.system() == 'Windows':
import winreg
with winreg.OpenKey(winreg.HKEY_CLASSES_ROOT, r'*\shell\Open with Sublime Text\command') as key:
exe = winreg.QueryValue(key, None)
else:
# https://stackoverflow.com/a/39149470/4473405
import shutil
exe = shutil.which('subl')
return path.dirname(exe)
评论列表
文章目录