What is rstrip() in python?

Mark Lawrence breamoreboy at yahoo.co.uk
Sun Nov 9 15:17:16 CET 2014

On 09/11/2014 11:11, satishmlmlml at 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?

> import sqlite3
> conn = sqlite3.connect('dbase1')
> curs = conn.cursor()
> file = open('data.txt')
> rows = [line.rstrip().split(',') for line in file]

My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

More information about the Python-list mailing list