Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _desktop_directory():
try:
if sys.platform.startswith('win'):
import appdirs
# https://msdn.microsoft.com/en-us/library/windows/desktop/bb762494(v=vs.85).aspx
return appdirs._get_win_folder('CSIDL_DESKTOPDIRECTORY')
else:
return os.path.join(os.path.expanduser('~'), 'Desktop')
except (KeyError, ValueError):
return os.getcwd()