With reference to my question at SuperUser, I am facing a puzzling situation where using du -sh /media/ExternalHd/myfolder/* works as expected from terminal, but using p=subprocess.Popen(['du', '-sh', '/media/ExternalHd/myfolder/*'], stdout=subprocess.PIPE) in a python script shows error du: cannot access /media/ExternalHd/myfolder/*: No such file or directory
With reference to my question at SuperUser , I am facing a puzzling situation
Share
The terminal expands the * for you.
To tell subprocess to do that:
Or you could use the glob module to expand the * yourself,
if you needed more control