def interactive_open(targets, command):
 assert command
 try:
  args = shlex_split(command)
 except ValueError:
  args = [command]
 args.insert(0, args[0])
 args += targets
 return os.execlp(*args)

def interactive_open ( targets , command ) : assert command try : args = shlex_split ( command ) except ValueError : args = [ command ] args . insert ( 0 , args [ 0 ] ) args += targets return os . execlp ( * args )
open the files in targets by execing a new command .