osdir.com

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Issue in using "subprocess.Popen" for parsing the command output


On Mon, Nov 26, 2018 at 5:40 AM srinivasan <srinivasan.rns at gmail.com> wrote:
>
> Dear Karsten,
>
> With the help of Mrab Inputs, I tried Even with  "return
> stdout.strip().decode("utf-8")", it still seems to be an issue, I am using
> python 3.6, is this causing a issue?

No, it isn't. Two things are causing most of your issues.

1) You are trying to *get your homework done*, rather than actually
gain competence. Slow down. Read some documentation. Don't fire off
another request to the mailing list the moment you've tried one thing;
instead, do some research.

2) You don't currently understand what decode() actually means. I
don't fault you for that; a lot of people don't understand it, and it
was thrown at you in a suggestion without any explanation. But
encode() and decode() are not magical incantations to be inserted
randomly until your code works. Read these:

https://nedbatchelder.com/text/unipain.html
https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/

I'll leave you with those.

ChrisA