Re: A simple question string.replace

2006-01-31 Thread bruno at modulix
Haibao Tang wrote: > I have a two-column data file like this > 1.12.3 > 2.211.1 > 4.31.1 > ... > Is it possible to substitue all '1.1' to some value else without using > re. I suppose that you don't want '11.1' to be affected. raw_data=""" 1.12.3 2.211.1 4.31.1 """ data =

Re: A simple question string.replace

2006-01-30 Thread I V
Haibao Tang wrote: > Is it possible to substitue all '1.1' to some value else without using > re. You could try: import sys values = sys.stdin.readline().split() while values: results = [] for value in values: if value != '1.1': results.append(value) else:

Re: A simple question string.replace

2006-01-30 Thread Emile van Sebille
"Haibao Tang" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I have a two-column data file like this > 1.12.3 > 2.211.1 > 4.31.1 > ... > Is it possible to substitue all '1.1' to some value else without using > re. > Yes -- data = """1.12.3 2.211.1 4.31.1"""

A simple question string.replace

2006-01-30 Thread Haibao Tang
I have a two-column data file like this 1.12.3 2.211.1 4.31.1 ... Is it possible to substitue all '1.1' to some value else without using re. Thanks. -- http://mail.python.org/mailman/listinfo/python-list