Re: What is rstrip() in python?

2014-11-11 Thread Will Acheson
On Sunday, November 9, 2014 6:12:24 AM UTC-5, satish...@gmail.com wrote: > What is rstrip() in python? > > What does it do in the following piece of code? > > import sqlite3 > conn = sqlite3.connect('dbase1') > curs = conn.cursor() > > file = open(

Re: What is rstrip() in python?

2014-11-09 Thread Joel Goldstick
On Sun, Nov 9, 2014 at 12:46 PM, Terry Reedy wrote: > On 11/9/2014 6:11 AM, satishmlm...@gmail.com wrote: >> >> What is rstrip() in python? google on 'rstrip python' gets this at first link: https://docs.python.org/2/library/stdtypes.html#str.rstrip google is your frien

Re: What is rstrip() in python?

2014-11-09 Thread Terry Reedy
On 11/9/2014 6:11 AM, satishmlm...@gmail.com wrote: What is rstrip() in python? The manuals have a rather complete index. If 'rstrip' is missing from the index, let us know so we can fix it. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: What is rstrip() in python?

2014-11-09 Thread Mark Lawrence
On 09/11/2014 11:11, satishmlm...@gmail.com wrote: What is rstrip() in python? It's a function or method call. What does it do in the following piece of code? I'm not actually sure. Would you be kind enough to look it up in the documentation for me and let me know, thanks?

Re: What is rstrip() in python?

2014-11-09 Thread Steven D'Aprano
satishmlm...@gmail.com wrote: > What is rstrip() in python? Have you read the Fine Manual? Did you try googling first? https://duckduckgo.com/html/?q=python+rstrip > What does it do in the following piece of code? It removes trailing whitespace. > import sqlite3 > conn = sql

Re: What is rstrip() in python?

2014-11-09 Thread Chris Angelico
On Sun, Nov 9, 2014 at 10:11 PM, wrote: > What is rstrip() in python? > > What does it do in the following piece of code? > > import sqlite3 > conn = sqlite3.connect('dbase1') > curs = conn.cursor() > > file = open('data.txt') > rows = [line.

What is rstrip() in python?

2014-11-09 Thread satishmlmlml
What is rstrip() in python? What does it do in the following piece of code? import sqlite3 conn = sqlite3.connect('dbase1') curs = conn.cursor() file = open('data.txt') rows = [line.rstrip().split(',') for line in file] -- https://mail.python.org/mailman/listinfo/python-list

Re: rstrip()

2010-07-19 Thread News123
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

Re: rstrip()

2010-07-18 Thread python
And don't forget the oft requested strip_tease(). Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: rstrip()

2010-07-18 Thread Ethan Furman
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

Re: rstrip()

2010-07-18 Thread News123
> a string like ' \t'. >> >> The doc is rather clear about it: >> str.rstrip([chars]) >> >> It is marked 'chars' and not 'suffix' >> >> The textual description is even clearer: >> "The chars argument is not a suffix

Re: rstrip()

2010-07-18 Thread MRAB
is even clearer: "The chars argument is not a suffix; rather, all combinations of its values are stripped:" When I asked in this grpup about a way of how to strip off a prefix I never even considered strip as a solution having read the doc before. I also think, that the function

Re: rstrip()

2010-07-18 Thread News123
and not 'suffix' The textual description is even clearer: "The chars argument is not a suffix; rather, all combinations of its values are stripped:" When I asked in this grpup about a way of how to strip off a prefix I never even considered strip as a solution having read the do

Re: rstrip()

2010-07-18 Thread Thomas Jollans
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

Re: rstrip()

2010-07-18 Thread News123
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

Re: rstrip()

2010-07-17 Thread Mark Lawrence
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" f

Re: rstrip()

2010-07-17 Thread MRAB
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-d

Re: rstrip()

2010-07-17 Thread Chris Rebert
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

Re: rstrip()

2010-07-17 Thread News123
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")

Re: rstrip()

2010-07-16 Thread Novocastrian_Nomad
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(&

Re: rstrip()

2010-07-16 Thread MRAB
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 expecte

Re: rstrip()

2010-07-16 Thread Ken Watford
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-

Re: rstrip()

2010-07-16 Thread Thomas Jollans
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".

Re: rstrip()

2010-07-16 Thread Shashwat Anand
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-

rstrip()

2010-07-16 Thread Jason Friedman
$ 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. -- http://mail.python.org/mailman/listinfo/python-list

Re: rstrip error python2.4.3 not in 2.5.1?

2008-02-29 Thread Tim Roberts
_extract_bookmarks_from_url_history >timestamp = datetime.datetime.strptime(month_string, '%b ‘ >%y') >AttributeError: type object 'datetime.datetime' has no attribute >'strptime' I suppose it is cruel of me, but I find it hilarious that you looked at t

Re: rstrip error python2.4.3 not in 2.5.1?

2008-02-29 Thread Philipp Pagel
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_

Re: rstrip error python2.4.3 not in 2.5.1?

2008-02-29 Thread dirkheld
> > 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

Re: rstrip error python2.4.3 not in 2.5.1?

2008-02-28 Thread subeen
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

Re: rstrip error python2.4.3 not in 2.5.1?

2008-02-28 Thread Terry Reedy
"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) wi

rstrip error python2.4.3 not in 2.5.1?

2008-02-28 Thread dirkheld
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 code fails to work on an ubuntu server with python 2.4.3 I was wonderin