Advertisement
Guest User

Untitled

a guest
May 22nd, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # encoding: utf-8
  3. #
  4. # Copyright (c) 2008 Doug Hellmann All rights reserved.
  5. #
  6. """
  7. """
  8.  
  9. __version__ = "$Id$"
  10. #end_pymotw_header
  11.  
  12. import readline
  13.  
  14. def startup_hook():
  15. readline.insert_text('from startup_hook')
  16.  
  17. def pre_input_hook():
  18. readline.insert_text(' from pre_input_hook')
  19. readline.redisplay()
  20.  
  21. readline.set_startup_hook(startup_hook)
  22. readline.set_pre_input_hook(pre_input_hook)
  23. readline.parse_and_bind('tab: complete')
  24.  
  25. while True:
  26. line = raw_input('Prompt ("stop" to quit): ')
  27. if line == 'stop':
  28. break
  29. print 'ENTERED: "%s"' % line
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement