Re: 回复: how can I implement "cd" like shell in Python?

Kushal Kumaran kushal.kumaran at gmail.com
Thu Jun 28 09:46:23 EDT 2012


Alex chen <wustcsvstudio at vip.qq.com> wrote:

>I just want to write a python program,it can be called in the linux
>terminal like the command "cd" to change the directory of the shell
>terminal 
>

This cannot be done. Shells implement cd as a builtin, rather than a command such as /usr/bin/cd because there is no way to change the current working directory of your parent process. 

Also, policy on this mailing list is to put your reply below the text you are quoting, as I'm doing here. It's called bottom posting. 

<snipped further quoted material>

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.



More information about the Python-list mailing list