在~目录下添加一个文件,名字为.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
时间: 2024-09-29 04:44:58