Steve thank you. The problem is that you can only run commands from Popen or os.system and stuff. You cant run bash shell builtin commands for some reason.
I was able to get this to work. What I did is call this: Popen(["bash -c 'source $HOME/.bashrc;alias'"],shell=True,stdout=PIPE).stdout.read() and make sure you don't have a line like this in your .bashrc: [ -z "$PS1" ] && return Another approach I came up with was to set aliases and functions as a environment variable and access them with os.environ. this is how I'm doing it. export ALIASES=`alias|awk '{print $2}'|cut -d = -f 1|xargs` export FUNCTIONS=`declare -F|awk '{print $3}'|xargs` use this at the end or the .bashrc and then you can access defined aliases and functions inside python with environ -Alex Goretoy
-- http://mail.python.org/mailman/listinfo/python-list