Sergi Pasoev wrote:
> Do you mean to implement the cd command ? To what extent do you want to
> implement it ? if what you want is just to have a script to change the
> current working directory, it is as easy as this:
>
>
> import sys
> import os
> os.chdir(sys.argv[1])
>
> plus you could add
On Thu, 28 Jun 2012 20:28:40 +0800, Alex chen 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
>
>
>
That would not only be needlesly re-inventing the wheel but making it
square in the
On 6/28/2012 7:28, Alex chen 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
You "can't" do this; a program the shell runs cannot affect the shell's
execution.
What you have to do is have s
OK,I see!
Thank you everyone.
-- Original --
From: "Evan Driscoll";
Date: Thu, Jun 28, 2012 10:27 PM
To: "Alex chen";
Cc: "d"; "python-list";
Subject: Re: how can I implement "cd" like shell in
Alex chen 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 cha
lex Chen";
????: "python-list";
: Re: how can I implement "cd" like shell in Python?
On 06/28/2012 05:30 AM, ?????? wrote:
> how can I implement "cd" like shell in Python?
>
import os
os.chdir("newdirectory")
But the more important
On 06/28/2012 05:30 AM, 梦幻草 wrote:
> how can I implement "cd" like shell in Python?
>
import os
os.chdir("newdirectory")
But the more important question is why you want to. Inside a Python
program, many people find that changing directory causes unexpected
difficul
Am 28.06.2012 13:09, schrieb Sergi Pasoev:
> Do you mean to implement the cd command ? To what extent do you want to
> implement it ? if what you want is just to have a script to change the
> current working directory, it is as easy as this:
Please note that you can't change the working directory
On 28/06/12 13:09:14, Sergi Pasoev wrote:
> Do you mean to implement the cd command ? To what extent do you want to
> implement it ? if what you want is just to have a script to change the
> current working directory, it is as easy as this:
>
>
> import sys
> import os
> os.chdir(sys.argv[1])
>
Do you mean to implement the cd command ? To what extent do you want to
implement it ? if what you want is just to have a script to change the
current working directory, it is as easy as this:
import sys
import os
os.chdir(sys.argv[1])
plus you could add some error-handling code.
--
http://mail
how can I implement "cd" like shell in Python?--
http://mail.python.org/mailman/listinfo/python-list
11 matches
Mail list logo