I would say the best way would be to use lstrip...
path='/path/to/file'
stripped_path = path.lstrip('/')
Cheers
--Brett
> Hello,
> I want to strip the first '/' from the following:
>
> '/path/to/file'
>
> How can I do this?
>
> Dave
> ___
> Tutor mailli
Thank you for the replies.
Original Message
From: Emad Nawfal (عماد نوفل)
To: davidwil...@safe-mail.net
Cc: tutor@python.org
Subject: Re: [Tutor] how to remove first '/'
Date: Tue, 25 Aug 2009 18:01:26 -0400
>
>
> On Tue, Aug 25, 2009 at 5:55 PM, wr
On Tue, Aug 25, 2009 at 5:55 PM, wrote:
> Hello,
> I want to strip the first '/' from the following:
>
> '/path/to/file'
>
> How can I do this?
>
> Dave
> ___
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
If I
On Tue, Aug 25, 2009 at 3:55 PM, wrote:
> Hello,
> I want to strip the first '/' from the following:
>
> '/path/to/file'
>
> How can I do this?
>
> Dave
> ___
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
there
Hello,
I want to strip the first '/' from the following:
'/path/to/file'
How can I do this?
Dave
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor