<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">As per the standard posted by the UNICODE for the Devnagari script<br>
used for Hindi and some other languages of India, we have a standard<br>
set, like from the range of 0900-097F.<br>
Where, we have numbers for each character:<br>
like 0904 for Devnagari letter short a, etc.<br>
Now, if write a program,<br>
<br>
where<br>
ch="0904"<br>
and I like to see the Devnagari letter short a as output then how<br>
should I proceed? Can codecs help me or should I use unicodedata?</blockquote><div><br></div><div>If you're writing a program, you can include that character with u"\u0904"; the \u escape inside a unicode string is a how you write any arbitrary unicode literal in python. In Python 2, u"string" is a unicode string, and "string" is a regular byte string. In Python 3, you don't need that 'u' on front because "string" is a unicode string. You didn't specify your version, so whichever is appropriate.</div>

<div><br></div><div>So first, use a unicode string, and second directly write the actual character with \u instead of just writing the number into a string. That'll result in a string with a single real character in it, and if you are on a terminal which is set up to display unicode (with a proper font and such), you should be able to "print ch" and see the devnagari character that way.</div>

<div><br></div><div>The statement:</div><div><br></div><div>    print u"\u0904"</div><div><br></div><div>should print your character. If you want to look up characters by name instead of number, you can use unicodedata, and do:</div>

<div><br></div><div>    print unicodedata.lookup("DEVANAGARI LETTER SHORT A")</div><div><br></div><div>HTH,</div><div><br></div><div>--S</div></div>