Re: hex question

2010-06-25 Thread Dave Angel
Sneaky Wombat wrote: Why is python turning \x0a into a \n ? In [120]: h='\x0a\xa8\x19\x0b' In [121]: h Out[121]: '\n\xa8\x19\x0b' I don't want this to happen, can I prevent it? You don't say what you do want. Currently, you have a literal that describes four characters. Were you tryin

Re: hex question

2010-06-25 Thread Matt McCredie
Sneaky Wombat gmail.com> writes: > > Why is python turning \x0a into a \n ? > > In [120]: h='\x0a\xa8\x19\x0b' > > In [121]: h > Out[121]: '\n\xa8\x19\x0b' > > I don't want this to happen, can I prevent it? 'h' is an ascii string. The ascii encoding for '\n' is the number(byte) 0x0A. When y

Re: hex question

2010-06-25 Thread Ethan Furman
Sneaky Wombat wrote: Why is python turning \x0a into a \n ? In [120]: h='\x0a\xa8\x19\x0b' In [121]: h Out[121]: '\n\xa8\x19\x0b' I don't want this to happen, can I prevent it? '\x0a' == '\n' -- http://mail.python.org/mailman/listinfo/python-list

Re: hex question

2010-06-25 Thread Emile van Sebille
On 6/25/2010 1:20 PM Sneaky Wombat said... Why is python turning \x0a into a \n ? In [120]: h='\x0a\xa8\x19\x0b' In [121]: h Out[121]: '\n\xa8\x19\x0b' I don't want this to happen, can I prevent it? It's not happening. What you're seeing is the representation of the four bytes, and \x0a

hex question

2010-06-25 Thread Sneaky Wombat
Why is python turning \x0a into a \n ? In [120]: h='\x0a\xa8\x19\x0b' In [121]: h Out[121]: '\n\xa8\x19\x0b' I don't want this to happen, can I prevent it? -- http://mail.python.org/mailman/listinfo/python-list