zoukankan      html  css  js  c++  java
  • python环境下使用tab自动补全命令

    # vim /usr/lib/python2.7/dist-packages/tab.py

    加入如下内容:

    #!/usr/bin/env python 
    # python startup file 
    import sys
    import readline
    import rlcompleter
    import atexit
    import os
    # tab completion 
    readline.parse_and_bind('tab: complete')
    # history file 
    histfile = os.path.join(os.environ['HOME'], '.pythonhistory')
    try:
        readline.read_history_file(histfile)
    except IOError:
        pass
    atexit.register(readline.write_history_file, histfile)
    del os, histfile, readline, rlcompleter



    测试:

    # python
    Python 2.7.3 (default, Aug  1 2012, 05:16:07) 
    [GCC 4.6.3] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sys
    >>> import tab
    >>> sys.
    sys.__class__(              sys.argv                    sys.hexversion
    sys.__delattr__(            sys.builtin_module_names    sys.long_info
    sys.__dict__                sys.byteorder               sys.maxint
    sys.__displayhook__(        sys.call_tracing(           sys.maxsize
    sys.__doc__                 sys.callstats(              sys.maxunicode
    sys.__excepthook__(         sys.copyright               sys.meta_path
    sys.__format__(             sys.displayhook(            sys.modules
    sys.__getattribute__(       sys.dont_write_bytecode     sys.path
    sys.__hash__(               sys.exc_clear(              sys.path_hooks
    sys.__init__(               sys.exc_info(               sys.path_importer_cache
    sys.__name__                sys.exc_type                sys.platform
    sys.__new__(                sys.excepthook(             sys.prefix
    sys.__package__             sys.exec_prefix             sys.ps1
    sys.__reduce__(             sys.executable              sys.ps2
    sys.__reduce_ex__(          sys.exit(                   sys.py3kwarning
    sys.__repr__(               sys.exitfunc(               sys.pydebug
    sys.__setattr__(            sys.flags                   sys.setcheckinterval(
    sys.__sizeof__(             sys.float_info              sys.setdlopenflags(
    sys.__stderr__              sys.float_repr_style        sys.setprofile(
    sys.__stdin__               sys.getcheckinterval(       sys.setrecursionlimit(
    sys.__stdout__              sys.getdefaultencoding(     sys.settrace(
    sys.__str__(                sys.getdlopenflags(         sys.stderr
    sys.__subclasshook__(       sys.getfilesystemencoding(  sys.stdin
    sys._clear_type_cache(      sys.getprofile(             sys.stdout
    sys._current_frames(        sys.getrecursionlimit(      sys.subversion
    sys._getframe(              sys.getrefcount(            sys.version
    sys._mercurial              sys.getsizeof(              sys.version_info
    sys.api_version             sys.gettrace(               sys.warnoptions


  • 相关阅读:
    HTML5课程
    css3兼容代码
    动画
    css3学习笔记(一)
    3d旋转
    Windows安装IIS后,启动网站报错:不能在此路径中使用此配置节……
    AngularJs1.X学习--路由
    Angular学习笔记 ——input 标签上的【name属性】和【ngModelOptions属性】
    Angular学习笔记【ngx-bootstrap】中的 tabset
    TFS 签入时,提示“变更集注释策略 中的内部错误……”
  • 原文地址:https://www.cnblogs.com/reblue520/p/6239782.html
Copyright © 2011-2022 走看看