Please change this to use os.getcwd(). See http://docs.python.org/2/library/os.html#os.getcwd

You won't have to spawn a new process and strip and all that crap.