I caught a bug in my code! Thank you for pointing it out!
In order for Example 2 to run properly, it should read:
lsprocess = sp.run("ls ./_drafts", shell=True, stdout=sp.PIPE)
Running the snippet in the interpreter really quick confirms it. lsprocess.stdout doesn't even exist without the stdout=sp.PIPE part.
lsprocess.stdout
stdout=sp.PIPE
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I caught a bug in my code! Thank you for pointing it out!
In order for Example 2 to run properly, it should read:
Running the snippet in the interpreter really quick confirms it.
lsprocess.stdout
doesn't even exist without thestdout=sp.PIPE
part.