On Fri, Aug 17, 2012 at 8:09 AM, Charles Jensen <hopefullychar...@gmail.com> wrote: > How would I use ord() to find the unicode value of a string stored in a > variable? > > So the following 2 lines of code will give me the ascii value of the variable > a. How do I specify ord to give me the unicode value of a? > > a = '…' > ord(a)
I presume you're talking about Python 2, because in Python 3 your string variable is a Unicode string and will behave as you describe above. You'll need to look into what the encoding is, and figure it out from there. ChrisA -- http://mail.python.org/mailman/listinfo/python-list