m2m模型翻译
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.1 KiB

6 months ago
  1. # -*- coding: UTF-8 -*-
  2. # Example snippet to use in a PYTHONSTARTUP file
  3. from __future__ import print_function, unicode_literals, absolute_import
  4. try:
  5. import pyreadline.rlmain
  6. #pyreadline.rlmain.config_path=r"c:\xxx\pyreadlineconfig.ini"
  7. import readline, atexit
  8. import pyreadline.unicode_helper
  9. #
  10. #
  11. #Normally the codepage for pyreadline is set to be sys.stdout.encoding
  12. #if you need to change this uncomment the following line
  13. #pyreadline.unicode_helper.pyreadline_codepage="utf8"
  14. except ImportError:
  15. print("Module readline not available.")
  16. else:
  17. #import tab completion functionality
  18. import rlcompleter
  19. #Override completer from rlcompleter to disable automatic ( on callable
  20. completer_obj = rlcompleter.Completer()
  21. def nop(val, word):
  22. return word
  23. completer_obj._callable_postfix = nop
  24. readline.set_completer(completer_obj.complete)
  25. #activate tab completion
  26. readline.parse_and_bind("tab: complete")
  27. readline.read_history_file()
  28. atexit.register(readline.write_history_file)
  29. del readline, rlcompleter, atexit