DEV Community

Discussion on: Python for Bash

Collapse
 
_andy_lu_ profile image
Andy Lu

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.