Re: read string in bits

2009-01-14 Thread Mark Smith
On Jan 14, 7:44 am, ts wrote: > On Jan 14, 3:32 pm, Chris Rebert wrote: > > > > > On Tue, Jan 13, 2009 at 11:21 PM, ts wrote: > > > hi, is there a way to read a character/string into bits in python? > > > > i understand that character is read in bytes. Do i have to write a > > > function to conv

Re: read string in bits

2009-01-14 Thread Hendrik van Rooyen
"Chris Rebert" wrote: > It's not quite clear to me what you mean, but here are 2 guesses: > - If you want to convert an ASCII character to its ASCII integer > value, use ord() > - If you want to convert an integer into a string of its base-2 > representation, use bin() [requires Python 2.6, I th

Re: read string in bits

2009-01-14 Thread Mark Smith
On Jan 14, 7:44 am, ts wrote: > On Jan 14, 3:32 pm, Chris Rebert wrote: > > > > > On Tue, Jan 13, 2009 at 11:21 PM, ts wrote: > > > hi, is there a way to read a character/string into bits in python? > > > > i understand that character is read in bytes. Do i have to write a > > > function to conv

Re: read string in bits

2009-01-14 Thread John Machin
On Jan 14, 6:44 pm, ts wrote: > On Jan 14, 3:32 pm, Chris Rebert wrote: > > > > > On Tue, Jan 13, 2009 at 11:21 PM, ts wrote: > > > hi, is there a way to read a character/string into bits in python? > > > > i understand that character is read in bytes. Do i have to write a > > > function to conv

Re: read string in bits

2009-01-13 Thread ts
On Jan 14, 3:32 pm, Chris Rebert wrote: > On Tue, Jan 13, 2009 at 11:21 PM, ts wrote: > > hi, is there a way to read a character/string into bits in python? > > > i understand that character is read in bytes. Do i have to write a > > function to convert it myself into 1010101 or there is a librar

Re: read string in bits

2009-01-13 Thread Chris Rebert
On Tue, Jan 13, 2009 at 11:21 PM, ts wrote: > hi, is there a way to read a character/string into bits in python? > > i understand that character is read in bytes. Do i have to write a > function to convert it myself into 1010101 or there is a library in > python that enable me to do that? It's no

read string in bits

2009-01-13 Thread ts
hi, is there a way to read a character/string into bits in python? i understand that character is read in bytes. Do i have to write a function to convert it myself into 1010101 or there is a library in python that enable me to do that? -- http://mail.python.org/mailman/listinfo/python-list