日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > python >内容正文

python

Python tab 补全

發(fā)布時(shí)間:2023/12/10 python 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Python tab 补全 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

1. 先準(zhǔn)備一個(gè)tab.py的腳本

? shell> cat tab.py

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 #!/usr/bin/python # python tab 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

2. 查看Python默認(rèn)的模塊存放地址

1 2 3 4 5 6 7 [root@localhost ~]# python Python?2.6.6?(r266:84292, Nov?22?2013,?12:16:22) [GCC?4.4.7?20120313?(Red Hat?4.4.7-4)] on linux2 Type?"help",?"copyright",?"credits"?or?"license"?for?more information. >>>?import?sys >>> sys.path ['', '/usr/lib64/python26.zip', '/usr/lib64/python2.6', '/usr/lib64/python2.6/plat-linux2',?

3. 拷貝該腳本到默認(rèn)模塊存放路徑

1 cp?tab.py??/usr/lib64/python2.6/

4. 現(xiàn)在可以用了

本文轉(zhuǎn)自不要超過24個(gè)字符博客51CTO博客,原文鏈接http://blog.51cto.com/cstsncv/1917139如需轉(zhuǎn)載請自行聯(lián)系原作者


cstsncv

總結(jié)

以上是生活随笔為你收集整理的Python tab 补全的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。