Configure your prompt

Set your path or install a good prompt like ipython

PYTHONPATH

defaults on the current directory you can add a path to point to some other library

put this in your .bashrc (under linux), under windows... I don’t know:

export PYTHONPATH:`pwd`

export PYTHONPATH=$PYTHONPATH:'/usr/share':'/toto/titi/tata'

alias pyenv='export PYTHONPATH=`pwd`:$PYTHONPATH'

export PYTHONSTARTUP='$HOME/.pystartup'
PYTHONSTARTUP

the pystartup enables us to set the

  • autocompletion
  • the history of the commands

example of .pystartup

# Store the file in ~/.pystartup, and set an environment variable to point to
# it, e.g. "export PYTHONSTARTUP=/max/home/itamar/.pystartup" in bash.
#
# Note that PYTHONSTARTUP does *not* expand "~", so you have to put in the full
# path to your home directory.
import rlcompleter
import readline
readline.parse_and_bind("tab: complete")

import os
histfile = os.path.join(os.environ["HOME"], ".pyhist")
try:
    readline.read_history_file(histfile)
except IOError:
    pass

import atexit
atexit.register(readline.write_history_file, histfile)
del os, histfile

# enhanced completion
#import rlcompleter2
#rlcompleter2.setup()