summaryrefslogtreecommitdiff
path: root/third_party/Python/module/pexpect-2.4/examples/python.py
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-01-02 19:26:05 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-01-02 19:26:05 +0000
commit14f1b3e8826ce43b978db93a62d1166055db5394 (patch)
tree0a00ad8d3498783fe0193f3b656bca17c4c8697d /third_party/Python/module/pexpect-2.4/examples/python.py
parent4ee8c119c71a06dcad1e0fecc8c675e480e59337 (diff)
Notes
Diffstat (limited to 'third_party/Python/module/pexpect-2.4/examples/python.py')
-rw-r--r--third_party/Python/module/pexpect-2.4/examples/python.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/third_party/Python/module/pexpect-2.4/examples/python.py b/third_party/Python/module/pexpect-2.4/examples/python.py
index d8c986652e6d..e7ef462ba680 100644
--- a/third_party/Python/module/pexpect-2.4/examples/python.py
+++ b/third_party/Python/module/pexpect-2.4/examples/python.py
@@ -7,10 +7,10 @@ the user interactive control over the session. Why? For fun... """
# c = pexpect.spawn ('/usr/bin/env python ./python.py')
import pexpect
-c = pexpect.spawn ('/usr/bin/env python')
-c.expect ('>>>')
+c = pexpect.spawn('/usr/bin/env python')
+c.expect('>>>')
print 'And now for something completely different...'
-f = lambda s:s and f(s[1:])+s[0] # Makes a function to reverse a string.
+f = lambda s: s and f(s[1:]) + s[0] # Makes a function to reverse a string.
print f(c.before)
print 'Yes, it\'s python, but it\'s backwards.'
print
@@ -19,4 +19,3 @@ print c.after,
c.interact()
c.kill(1)
print 'is alive:', c.isalive()
-