Mar-18-2019, 06:05 PM
Hi guys,
first time poster sorry if my post is in the wrong format,
anyway I'm following the docs - https://docs.python.org/3/library/subpro...ommunicate
secondly I read that this will return the output of the command in bytes but what if I want to get the string of the output and not the bytes? I read that you need to to specify a text mode attribute but how is this done?
thanks
first time poster sorry if my post is in the wrong format,
anyway I'm following the docs - https://docs.python.org/3/library/subpro...ommunicate
prc.communicate()returns a tuple of stdout and stderr,
prc = popen(command,stdout = PIPE,stderr = PIPEso the above code creates a new process I specify that stdout will be PIPE,first off what does stdout = PIPE do and how does it relate the functionality in this case of the function/method prc.communicate()?
secondly I read that this will return the output of the command in bytes but what if I want to get the string of the output and not the bytes? I read that you need to to specify a text mode attribute but how is this done?
thanks