lou xiao writes:
I find a bug in str.lstrip, when i call str.lstrip, i get this result.
a.lstrip('device_')
'nfo'
Try
a.lstrip('_ecived')
You'll see that you get the same result. I suspect that you
misunderstand the meaning of the argument, which is not a sequence of
On 15-03-10, Facundo Batista wrote:
On Tue, Mar 10, 2015 at 2:27 PM, lou xiao lox.x...@gmail.com wrote:
tiny➜ ~ python
Python 2.7.5+ (default, Feb 27 2014, 19:37:08)
[GCC 4.8.1] on linux2
Type help, copyright, credits or license for more information.
a='device_info'
On Tue, Mar 10, 2015 at 2:27 PM, lou xiao lox.x...@gmail.com wrote:
tiny➜ ~ python
Python 2.7.5+ (default, Feb 27 2014, 19:37:08)
[GCC 4.8.1] on linux2
Type help, copyright, credits or license for more information.
a='device_info'
a.lstrip('device')
'_info'
a.lstrip('device_')
'nfo'
On
On Wed, Mar 11, 2015 at 4:27 AM, lou xiao lox.x...@gmail.com wrote:
I find a bug in str.lstrip, when i call str.lstrip, i get this result.
tiny➜ ~ python
Python 2.7.5+ (default, Feb 27 2014, 19:37:08)
[GCC 4.8.1] on linux2
Type help, copyright, credits or license for more information.
ths, i misunderstood the method
2015-03-11 1:33 GMT+08:00 Chris Angelico ros...@gmail.com:
On Wed, Mar 11, 2015 at 4:27 AM, lou xiao lox.x...@gmail.com wrote:
I find a bug in str.lstrip, when i call str.lstrip, i get this result.
tiny➜ ~ python
Python 2.7.5+ (default, Feb 27 2014,
* lou xiao lox.x...@gmail.com [2015-03-11 01:27:21 +0800]:
I find a bug in str.lstrip, when i call str.lstrip, i get this result.
You're misunderstanding how str.strip works. It takes a set of
characters and removes them all from the beginning:
abababcd.lstrip('ab')
'cd'
Florian
--
I find a bug in str.lstrip, when i call str.lstrip, i get this result.
tiny➜ ~ python
Python 2.7.5+ (default, Feb 27 2014, 19:37:08)
[GCC 4.8.1] on linux2
Type help, copyright, credits or license for more information.
a='device_info'
a.lstrip('device')
'_info'
a.lstrip('device_')
'nfo'
tiny➜
On 15-03-10, Ethan Furman wrote:
On 03/10/2015 10:57 AM, Isaac Schwabacher wrote:
On 15-03-10, Facundo Batista wrote:
On Tue, Mar 10, 2015 at 2:27 PM, lou xiao wrote:
tiny➜ ~ python
Python 2.7.5+ (default, Feb 27 2014, 19:37:08)
[GCC 4.8.1] on linux2
Type help, copyright, credits
On 03/10/2015 10:57 AM, Isaac Schwabacher wrote:
On 15-03-10, Facundo Batista wrote:
On Tue, Mar 10, 2015 at 2:27 PM, lou xiao wrote:
tiny➜ ~ python
Python 2.7.5+ (default, Feb 27 2014, 19:37:08)
[GCC 4.8.1] on linux2
Type help, copyright, credits or license for more information.