Source code for pipeLion.utils.platformUtils
import os
import sys
from pipeLion.core.errors.coreErrors import OsNotSupportedError
[docs]def userDirectory():
""" method returns the path to the user directory. It is platform independent for Linux, MacOsX and Windows
"""
return os.getenv('USERPROFILE') or os.getenv('HOME')
[docs]def launchFileWithDefaultApplication(file):
""" method will launch the given file with the default application set by the os.
:param file: the file, which should be opened
:type file: string:
"""
if currentPlatform() == 'linux':
os.system('xdg-open "%s"'%file)
else:
os.startfile(file)