¡@

Home 

python Programming Glossary: xa6

how to decode a non unicode character in python?

http://stackoverflow.com/questions/3870084/how-to-decode-a-non-unicode-character-in-python

continue if enc in iso 8859 1 cp1252 and re.search r xa4 xa6 xa8 xb4 xb8 xbc xbe string is not None continue try new_string..

convert a string of bytes into an int (python)

http://stackoverflow.com/questions/444591/convert-a-string-of-bytes-into-an-int-python

string of bytes into an int in python Say like this 'y xcc xa6 xbb' I came up with a clever stupid way of doing it sum ord.. way of doing it sum ord c i 8 for i c in enumerate 'y xcc xa6 xbb' 1 I know there has to be something builtin or in the standard.. from timeit import Timer Timer 'struct.unpack L y xcc xa6 xbb 0 ' 'import struct' .timeit 0.36242198944091797 Timer int..

python unicode handling differences between print and sys.stdout.write

http://stackoverflow.com/questions/8016236/python-unicode-handling-differences-between-print-and-sys-stdout-write

16 46 GCC 4.1.2 20080704 Red Hat 4.1.2 44 on linux2 a u' xa6' print a ¦ works just fine however sys.stdout.write a Traceback.. UnicodeEncodeError 'ascii' codec can't encode character u' xa6' in position 0 ordinal not in range 128 throws an error. The.. r267 88850 Aug 14 2011 12 32 40 GCC 4.6.2 on linux3 a u' xa6 n' sys.stdout.write a Traceback most recent call last File stdin..