ons reads ini oba line and 启用 clas
在~目录下添加一个文件,名字为. pythonstartup.py
- #!/usr/bin/python
- # -*- coding: UTF-8 -*-
- import readline, rlcompleter;
- readline.parse_and_bind("tab: complete"); # 启用Tab补全
- def igtk():
- globals()['gtk'] = __import__('gtk');
- globals()['thread'] = __import__('thread');
- gtk.gdk.threads_init();
- thread.start_new_thread(gtk.main, ());
- pass;
然后在. bashrc 中添加
- export PYTHONSTARTUP=~/.pythonstartup.py
Python 终端自动补全
来源: http://www.bubuko.com/infodetail-2056065.html