3 """This starts the python interpreter; captures the startup message; then gives
4 the user interactive control over the session. Why? For fun... """
6 # Don't do this unless you like being John Malkovich
7 # c = pexpect.spawn ('/usr/bin/env python ./python.py')
10 c = pexpect.spawn ('/usr/bin/env python')
12 print 'And now for something completely different...'
13 f = lambda s:s and f(s[1:])+s[0] # Makes a function to reverse a string.
15 print 'Yes, it\'s python, but it\'s backwards.'
17 print 'Escape character is \'^]\'.'
21 print 'is alive:', c.isalive()