writing a file:newbie question

Facundo Batista facundo at taniquetil.com.ar
Mon Mar 5 10:43:25 EST 2007


kavitha thankaian wrote:

>   say for example,,i have a file test.txt and the file has the list
>    
>   a,b,c,d,
>    
>   i would like to delete the trailing comma at the end,,,

>>> "a,b,c,d,".rstrip(",")
'a,b,c,d'

Regards,

-- 
.   Facundo
.
Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/






More information about the Python-list mailing list