On Fri, 21 Nov 2008 14:16:13 +0530, ganesh gajre wrote: > Hi all, > > I want to read file which is mapping file. Used in to map character from > ttf to unicode. > eg > > Map file contain data in the following way: > > 0 ० > 1 १ > 2 २ > 3 ३ > 4 ४ > 5 ५ > 6 ६ > 7 ७ > 8 ८ > 9 ९ > > Like this. Please use any unicode editor to view the text if it not > properly shown. > > Now i want to read both the character separately like: > > str[0]=0 and str2[0]=० > > How can i do this? > > please give me solution?
Well, because you said please... I assume the encoding of the second column is utf-8. You need something like this: # Untested. column0 = [] column1 = [] for line in open('somefile', 'r'): a, b = line.split() column0.append(a) column1.append(b.decode('utf-8')) -- Steven -- http://mail.python.org/mailman/listinfo/python-list