A dica é simples: Copie o código abaixo, e cole no arquivo ~/.pystartup:
import atexit, os, readline, rlcompleter
histFile = os.path.expanduser("~/.pyhistory")
def saveit(hf=histFile):
readline.write_history_file(hf)
if os.path.exists(histFile):
readline.read_history_file(histFile)
readline.parse_and_bind('tab: complete')
readline.set_history_length(2000)
atexit.register(saveit)
del os, atexit, rlcompleter, saveit, histFile
agora execute o seguinte comando:
export PYTHONSTARTUP=~/.pystartup
Coloque esse comando no final do seu arquivo ~/.bashrc para que fique salvo para próximas seções shell.
Para usar, basta executar o terminal python e utilizar a tecla "tab" para completar os comandos digitados.
Nenhum comentário:
Postar um comentário