Re: path slashes cleaning

2008-09-05 Thread Michael Wronna
Am 04.09.2008, 15:27 Uhr, schrieb Mike Driscoll <[EMAIL PROTECTED]>: On Sep 4, 8:25 am, "Mathieu Prevot" <[EMAIL PROTECTED]> wrote: Hi, for scripts that take arguments, I would like to remove the trailing slash if it's present. Is there something else than: a='/usr/local/lib/' if a[-1] == '/

Re: path slashes cleaning

2008-09-04 Thread Jason Scheirer
On Sep 4, 6:32 am, "Francesco Guerrieri" <[EMAIL PROTECTED]> wrote: > On Thu, Sep 4, 2008 at 3:25 PM, Mathieu Prevot <[EMAIL PROTECTED]> wrote: > > Hi, > > > for scripts that take arguments, I would like to remove the trailing > > slash if it's present. > > > Is there something else than: > > > a='

Re: path slashes cleaning

2008-09-04 Thread Francesco Guerrieri
On Thu, Sep 4, 2008 at 3:25 PM, Mathieu Prevot <[EMAIL PROTECTED]> wrote: > Hi, > > for scripts that take arguments, I would like to remove the trailing > slash if it's present. > > Is there something else than: > > a='/usr/local/lib/' > if a[-1] == '/': > a = list(a) > a.pop() > ''.join(a) > >

Re: path slashes cleaning

2008-09-04 Thread Mathieu Prevot
2008/9/4 Mathieu Prevot <[EMAIL PROTECTED]>: > Hi, > > for scripts that take arguments, I would like to remove the trailing > slash if it's present. > > Is there something else than: > > a='/usr/local/lib/' > if a[-1] == '/': > a = list(a) > a.pop() > ''.join(a) A dummy a.rstrip('/') Sorry fo

Re: path slashes cleaning

2008-09-04 Thread Mike Driscoll
On Sep 4, 8:25 am, "Mathieu Prevot" <[EMAIL PROTECTED]> wrote: > Hi, > > for scripts that take arguments, I would like to remove the trailing > slash if it's present. > > Is there something else than: > > a='/usr/local/lib/' > if a[-1] == '/': >   a = list(a) >   a.pop() >   ''.join(a) > > Thanks,

path slashes cleaning

2008-09-04 Thread Mathieu Prevot
Hi, for scripts that take arguments, I would like to remove the trailing slash if it's present. Is there something else than: a='/usr/local/lib/' if a[-1] == '/': a = list(a) a.pop() ''.join(a) Thanks, Mathieu -- http://mail.python.org/mailman/listinfo/python-list