proc = subprocess.Popen(['ls', '-v', self.localDbPath+'labris.urls.*'], stdout=subprocess.PIPE)
while True:
line = proc.stdout.readline()
if line != '':
print line
else:
break
When using the above code I get the error saying:
ls: /var/lib/labrisDB/labris.urls.*: No such file or directory
But when I dıo the same from shell I get no errors:
ls -v /var/lib/labrisDB/labris.urls.*
Also this doesn't give any error either:
proc = subprocess.Popen(['ls', '-v', self.localDbPath], stdout=subprocess.PIPE)
while True:
line = proc.stdout.readline()
if line != '':
print line
else:
break
Why is the first code failing? What am I missing?