Skip to content

Commit 2c39cc7

Browse files
author
Michael Zingale
committed
good example
1 parent c9c661c commit 2c39cc7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

examples/external/Popen/githash.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import subprocess
2+
import string
23

3-
prog = ["git", "rev-parse", "--abbrev-ref", "HEAD"]
4+
# issue the command 'git rev-parse HEAD'
5+
prog = ["git", "rev-parse", "HEAD"]
46
p0 = subprocess.Popen(prog, stdout=subprocess.PIPE,
5-
stderr=subprocess.STDOUT)
7+
stderr=subprocess.PIPE)
68
stdout0, stderr0 = p0.communicate()
79

810
print "stdout: {}".format(stdout0)
911
print "stderr: {}".format(stderr0)
1012

13+

0 commit comments

Comments
 (0)