1 #! /usr/bin/env python2 2 # Copyright 2017 Google Inc. 3 # Use of this source code is governed by a BSD-style license that can be 4 # found in the LICENSE file. 5 6 import os 7 import subprocess 8 import sys 9 10 def sysopen(arg): 11 plat = sys.platform 12 if plat.startswith('darwin'): 13 subprocess.call(["open", arg]) 14 elif plat.startswith('win'): 15 os.startfile(arg) 16 else: 17 subprocess.call(["xdg-open", arg]) 18 19 if __name__ == '__main__': 20 for a in sys.argv[1:]: 21 sysopen(a) 22