Editing a string

emile at fenx.com emile at fenx.com
Thu May 4 19:33:40 CEST 2000


import string
pr = string.strip(pr[:-1])

HTH
Emile van Sebille
emile at fenx.com

<kurtn at my-deja.com> wrote in message
news:<8esagm$b5a$1 at nnrp1.deja.com>...
> file=open('gs.txt','r')
> pr=''
> while 1:
> 	line = file.readline()
>  	if not line:
>  		break
>  	pr=pr+line
> file.close()
> print [pr]
> 
> output:
> ['attgctagcytr   \012']
> 
> How can I delete the space and \012 without editing the file. Is there
> a built-in function?
> 
> thanks
> k
> 
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.
> -- 
> http://www.python.org/mailman/listinfo/python-list
>




More information about the Python-list mailing list