It is entirely possible. You may have better luck placing it in ~/.bash_profile rather than ~/.profile. Some things, usually scripts, may run /bin/sh which could, on some configurations, source ~/.profile. The .bashrc file should be sourced for non-login shells and .bash_profile is only supposed to be sourced for login shells. On the other hand, you probably shouldn't be calling your python script quite that way. Fork it off if you have to.