PDA

View Full Version : how to use unichr??


LoneWolf78
12-10-2011, 05:41 PM
hi, i have been looking everywhere but nowhere could i find a descent example.

according to the doc's this should print the greek letter Sigma 'Σ' but i can't get it to work. I think i'm missing something but i dont know what and been wasting hours searching the web :(

i tried many variations and examples i have found but none do the job. could somebody please show me a simple example how to achieve this so i can acces unicode characters. as i badly need them.

(Python)

print unichr(03A9)


thank you.

kattkieru
12-13-2011, 07:22 PM
print(unichr(0x03A9)) worked for me. I think you need to have the 0x in there.

you can also print your sigma directly by prepending a u to the string like so:

print(u"Σ")

That gets into the encoding of your source file, though, which is something I don't know about.

CGTalk Moderation
12-13-2011, 07:22 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.