Can someone tell me how to encode the return statement so that it can decode it. Or whats needs to be changed to get encoded value.
Code
def run_process(cmd_args):
with subprocess.Popen(cmd_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as proc:
return proc.communicate()
res = run_process(cmd_args);
print(res)
print(res.decode("utf-8"))
Output
print(res.decode("utf-8"))
AttributeError: 'tuple' object has no attribute 'decode'