Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Text mode popen
#1
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

prc.communicate()
returns a tuple of stdout and stderr,

prc = popen(command,stdout = PIPE,stderr = PIPE
so 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
Reply


Messages In This Thread
Text mode popen - by adam2020 - Mar-18-2019, 06:05 PM
RE: Text mode popen - by snippsat - Mar-18-2019, 06:32 PM
RE: Text mode popen - by adam2020 - Mar-18-2019, 06:37 PM
RE: Text mode popen - by snippsat - Mar-18-2019, 06:46 PM
RE: Text mode popen - by adam2020 - Mar-18-2019, 07:35 PM
RE: Text mode popen - by snippsat - Mar-18-2019, 11:12 PM
RE: Text mode popen - by adam2020 - Mar-19-2019, 07:38 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  things that work in terminal mode but not in sublime mode alok 4 3,061 Aug-11-2021, 07:02 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020