def launchFile(path, line=-1, col1=-1, col2=-1):
    if sys.platform == "darwin":
        cleanPath = os.path.abspath(path)

        if os.path.isdir(cleanPath):
            os.system("open %s" % cleanPath)

        elif os.path.isfile(cleanPath):
            if line >= 0:
                os.system('mate -l %s "%s"' %  (line, cleanPath))
            else:
                os.system('mate "%s"' % cleanPath)
    
    elif sys.platform == "win32":
        cleanPath = os.path.abspath(path)

        if os.path.isdir(cleanPath):
            os.system("explorer %s" % cleanPath)

        elif os.path.isfile(cleanPath):
            scriptPath = "editMSVC.py"
            command = '%s "%s" %s %s %s' % (scriptPath, cleanPath, line, col1, col2)
            os.system(command)
dataset/ETHPy150Open joehewitt/devon/devon/jump.py/launchFile/original