-1

Solved with your help

#!/usr/bin/python
# -*- coding: utf-8 -*-
message = {'message1':'நாம்','message2':'செய்தி'}
a={}
for i in message.keys():
  if "message" in  i:
   a[i]=message[i]

status="success"
print a

got output: {'message2':'செய்தி','message1':'நாம்'}

Thanks for all your help!!!!

Owen Pauling
  • 9,864
  • 18
  • 50
  • 58
the-run
  • 1,021
  • 1
  • 10
  • 21

2 Answers2

1

You need to decode with 'utf-8' format in order to print/read as it is

print message['message1'].decode('utf-8')

This will print correctly.

thiruvenkadam
  • 3,623
  • 1
  • 23
  • 25
  • i know this method can do. But i need to get complete dict value . better u should see what i asked as output , i want to get the output to be {'message2':'செய்தி','message1':'நாம்'} – the-run Feb 24 '15 at 08:42
  • How you solved it? Can you add it as an answer here as none of our answers helped you in your use case? – thiruvenkadam Feb 26 '15 at 12:44
0

Have you tried writing them as literal string:

message = {'message1': r'நாம்','message2':r'செய்தி'}