def prep_for_subprocess(cmd, shell=False):
 if shell:
  if PY3:
   cmd = decode(cmd)
  else:
   cmd = encode(cmd)
 elif PY3:
  cmd = [decode(c) for c in cmd]
 else:
  cmd = [encode(c) for c in cmd]
 return cmd

def prep_for_subprocess ( cmd , shell = False ) : if shell : if PY3 : cmd = decode ( cmd ) else : cmd = encode ( cmd ) elif PY3 : cmd = [ decode ( c ) for c in cmd ] else : cmd = [ encode ( c ) for c in cmd ] return cmd
decode on python3 .