Dennis Lee Bieber wrote:
> On Sun, 18 Jul 2010 17:49:11 +0100, MRAB
> declaimed the following in gmane.comp.python.general:
>
>> How about 'strip_str', 'lstrip_str' and 'rstrip_str', or something
>
> Not sure what the first would do... unless one is envisioning
>
> "abracadabra".str
And don't forget the oft requested strip_tease().
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
MRAB wrote:
[snip]
How about 'strip_str', 'lstrip_str' and 'rstrip_str', or something
similar?
+1 on the names
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
MRAB wrote:
> News123 wrote:
>> Thomas Jollans wrote:
>>
>>>
string.rstrip( [ '-dir' ] )
or as
string.rstrip( '-dir' )
>>> The former should certainly raise an exception. '-dir' is not a single
>>> character !
>>> Or it should actually strip '-dir', or '-dir-dir', but not 'r--i'...
News123 wrote:
Thomas Jollans wrote:
string.rstrip( [ '-dir' ] )
or as
string.rstrip( '-dir' )
The former should certainly raise an exception. '-dir' is not a single
character !
Or it should actually strip '-dir', or '-dir-dir', but not 'r--i'... but
that's just silly.
It's silly with the
Thomas Jollans wrote:
>
>
>> string.rstrip( [ '-dir' ] )
>> or as
>> string.rstrip( '-dir' )
>
> The former should certainly raise an exception. '-dir' is not a single
> character !
> Or it should actually strip '-dir', or '-dir-dir', but not 'r--i'... but
> that's just silly.
>
It's silly wi
On 07/18/2010 01:18 PM, News123 wrote:
> Mark Lawrence wrote:
>> On 17/07/2010 23:17, MRAB wrote:
>>> Chris Rebert wrote:
On Fri, Jul 16, 2010 at 10:27 AM, MRAB
wrote:
> Jason Friedman wrote:
It's a pity that str.strip() doesn't actually take a set() of length-1
string
Mark Lawrence wrote:
> On 17/07/2010 23:17, MRAB wrote:
>> Chris Rebert wrote:
>>> On Fri, Jul 16, 2010 at 10:27 AM, MRAB
>>> wrote:
Jason Friedman wrote:
>>>
>>> It's a pity that str.strip() doesn't actually take a set() of length-1
>>> strings, which would make its behavior more obvious and
On 17/07/2010 23:17, MRAB wrote:
Chris Rebert wrote:
On Fri, Jul 16, 2010 at 10:27 AM, MRAB
wrote:
Jason Friedman wrote:
$ python
Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
"x.vsd-dir".rstrip("-
Chris Rebert wrote:
On Fri, Jul 16, 2010 at 10:27 AM, MRAB wrote:
Jason Friedman wrote:
$ python
Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
"x.vsd-dir".rstrip("-dir")
'x.vs'
I expected 'x.vsd'
On Fri, Jul 16, 2010 at 10:27 AM, MRAB wrote:
> Jason Friedman wrote:
>>
>> $ python
>> Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55)
>> [GCC 4.4.1] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>
> "x.vsd-dir".rstrip("-dir")
>>
>> 'x.vs'
>>
>> I ex
Jason Friedman wrote:
> $ python
> Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55)
> [GCC 4.4.1] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
"x.vsd-dir".rstrip("-dir")
> 'x.vs'
>
> I expected 'x.vsd' as a return value.
This is kind of similiar to the q
On Jul 16, 10:58 am, Jason Friedman wrote:
> $ python
> Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55)
> [GCC 4.4.1] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>> "x.vsd-dir".rstrip("-dir")
>
> 'x.vs'
>
> I expected 'x.vsd' as a return value.
One way to
Jason Friedman wrote:
$ python
Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
"x.vsd-dir".rstrip("-dir")
'x.vs'
I expected 'x.vsd' as a return value.
.strip, .lstrip and .rstrip treat their argumen
On Fri, Jul 16, 2010 at 12:58 PM, Jason Friedman wrote:
> $ python
> Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55)
> [GCC 4.4.1] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
"x.vsd-dir".rstrip("-dir")
> 'x.vs'
>
> I expected 'x.vsd' as a return value.
On 07/16/2010 06:58 PM, Jason Friedman wrote:
> $ python
> Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55)
> [GCC 4.4.1] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
"x.vsd-dir".rstrip("-dir")
> 'x.vs'
>
> I expected 'x.vsd' as a return value.
>>> "x-vs
On Fri, Jul 16, 2010 at 10:28 PM, Jason Friedman wrote:
> $ python
> Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55)
> [GCC 4.4.1] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> "x.vsd-dir".rstrip("-dir")
> 'x.vs'
>
> I expected 'x.vsd' as a return value.
dirkheld <[EMAIL PROTECTED]> wrote:
>>
>> What is the actual error message [SyntaxError, NameError? etc] that you
>> clipped?
>
>Here it is : I tought that I didn't matter because the deliciousapi
>worked fine on my mac.
>
>Traceback (most recent call last):
> File "delgraph.py", line 62, in ?
>
dirkheld <[EMAIL PROTECTED]> wrote:
> Here it is : I tought that I didn't matter because the deliciousapi
> worked fine on my mac.
> Traceback (most recent call last):
> File "delgraph.py", line 62, in ?
> url_metadata = d.get_url(site.rstrip())
> File "deliciousapi.py", line 269, in get_
>
> What is the actual error message [SyntaxError, NameError? etc] that you
> clipped?
Here it is : I tought that I didn't matter because the deliciousapi
worked fine on my mac.
Traceback (most recent call last):
File "delgraph.py", line 62, in ?
url_metadata = d.get_url(site.rstrip())
F
rstrip() works fine in python 2.4.3. May be the problem lies in
somewhere else.
I tried it in FC6 with Python 2.4.3:
>>> url = "abc.com\n"
>>> url.rstrip()
'abc.com'
regards,
Subeen.
http://love-python.blogspot.com/
On Feb 29, 2:30 am, dirkheld <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I wrote some
"dirkheld" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| Hi,
|
| I wrote some python code that retrieves urls from a txt file. In this
| code I use .rstrip() for removing the '\n' at the end of every url.
| While this code works on my mac (leopard) with python 2.5.1, this same
| c
22 matches
Mail list logo