Re: [Tutor] subprocess check_output

2017-09-20 Thread Alan Gauld via Tutor
On 20/09/17 22:09, Derek Smith wrote: > Why does python output this b and newline characters Because that's what the command is returning. The b indicates its an array of bytes (as opposed to a unicode string) Note the module dpocumentation for check_output() says: "By default, this function

[Tutor] subprocess check_output

2017-09-20 Thread Derek Smith
Why does python output this b and newline characters and how can I may it return just what I need, the number 8 w/no special characters? See below. I tried str(scratch), but no go, still prints that garbage. #!/bin/env python3 cmdstr= "/usr/bin/dsmadmc" id = "-id=dereksmith"