def shquote(arg):
 for c in ('"', "'", '\\', '#'):
  if (c in arg):
   return repr(arg)
 if (arg.split() != [arg]):
  return repr(arg)
 return arg

def shquote ( arg ) : for c in ( '"' , "'" , '\\' , '#' ) : if ( c in arg ) : return repr ( arg ) if ( arg . split ( ) != [ arg ] ) : return repr ( arg ) return arg
quote an argument for later parsing by shlex .