calling source command within python

mk mrkafk at
Mon Jul 21 19:59:11 CEST 2008

Jie wrote:
> Hi all,
> i'm having trouble executing os.system('source .bashrc') command
> within python, it always says that source not found and stuff. Any
> clue?

It _might_ be that the shell it fires up is /bin/sh and this in turn is 
not bash.

Anyway, it's better to use subprocess / Popen for this sort of operation.

More information about the Python-list mailing list