def create_mock_ssh_script(path):
 with open(path, 'w') as f:
  f.write('#!/bin/sh\n')
  f.write(('%s %s "$@"\n' % (pipes.quote(sys.executable), pipes.quote(os.path.abspath(__file__)))))
 os.chmod(path, (stat.S_IREAD | stat.S_IEXEC))

def create_mock_ssh_script ( path ) : with open ( path , 'w' ) as f : f . write ( '#!/bin/sh\n' ) f . write ( ( '%s %s "$@"\n' % ( pipes . quote ( sys . executable ) , pipes . quote ( os . path . abspath ( __file__ ) ) ) ) ) os . chmod ( path , ( stat . S_IREAD | stat . S_IEXEC ) )
dump a wrapper script to the given file object that runs this python script .