def p4_has_command(cmd):
 real_cmd = p4_build_cmd(['help', cmd])
 p = subprocess.Popen(real_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 p.communicate()
 return (p.returncode == 0)

def p4_has_command ( cmd ) : real_cmd = p4_build_cmd ( [ 'help' , cmd ] ) p = subprocess . Popen ( real_cmd , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) p . communicate ( ) return ( p . returncode == 0 )
ask p4 for help on this command .