1

Using && in subprocess.Popen for command chaining?

view story
linux-howto

http://stackoverflow.com – I'm using subprocess.Popen with Python, and I haven't come across an elegant solution for joining commands (i.e. foobar&& bizbang) via Popen. I could do this: p1 = subprocess.Popen(["mmls", "WinXP.E01"], stdout=subprocess.PIPE) result = p1.communicate()[0].split("\n") for line in result: script_log.write(line) script_log.write("\n") p1 = subprocess.Popen(["stat", "WinXP.E01"], stdout=subprocess.PIPE) result = p1.communicate()[0].split("\n") for line in result: script_log.write(line) But that really isn't very aesthetically pleasing (especially if I'm daisy-chaining mult (HowTos)