On Tue, Dec 23, 2008 at 5:05 AM, John Machin wrote:
> On Dec 23, 1:52 am, "Steven Woody" wrote:
>> On Mon, Dec 22, 2008 at 6:44 PM, Steven D'Aprano
>>
>> wrote:
>> > On Mon, 22 Dec 2008 14:56:45 +0800, Steven Woody wrote:
>>
>> >> The intension is to allocate 200 undefined bytes in memory.
>>
>>
On Dec 23, 1:52 am, "Steven Woody" wrote:
> On Mon, Dec 22, 2008 at 6:44 PM, Steven D'Aprano
>
> wrote:
> > On Mon, 22 Dec 2008 14:56:45 +0800, Steven Woody wrote:
>
> >> The intension is to allocate 200 undefined bytes in memory.
>
> > You *want* undefined bytes? Out of curiosity, what do you in
On 2008-12-22, Steven D'Aprano wrote:
> On Mon, 22 Dec 2008 14:56:45 +0800, Steven Woody wrote:
>
>> The intension is to allocate 200 undefined bytes in memory.
>
> You *want* undefined bytes? Out of curiosity, what do you intend to do
> with them?
Predict the future, of course.
--
Grant Edwar
On Mon, Dec 22, 2008 at 6:44 PM, Steven D'Aprano
wrote:
> On Mon, 22 Dec 2008 14:56:45 +0800, Steven Woody wrote:
>
>> The intension is to allocate 200 undefined bytes in memory.
>
> You *want* undefined bytes? Out of curiosity, what do you intend to do
> with them?
>
to receive/send network pack
On Mon, 22 Dec 2008 14:56:45 +0800, Steven Woody wrote:
> The intension is to allocate 200 undefined bytes in memory.
You *want* undefined bytes? Out of curiosity, what do you intend to do
with them?
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On 22 Dic, 03:23, "Steven Woody" wrote:
> Hi,
>
> What's the right type to represent a sequence of raw bytes. In C, we usually
> do
>
> 1. char buf[200] or
> 2. char buf[] = {0x11, 0x22, 0x33, ... }
>
> What's the equivalent representation for above in Python?
>
> Thanks.
>
> -
> narke
Usual
On Mon, Dec 22, 2008 at 4:35 PM, James Mills
wrote:
> On Mon, Dec 22, 2008 at 4:56 PM, Steven Woody wrote:
>> I thing "\x11\x22\x33" in python is not the {0x11, 0x22, 0x33} in C.
>> Since, a string in python is immutable, I can _not_ do something like:
>> b[1] = "\x55".
>>
>> And, how about char
On Mon, Dec 22, 2008 at 4:56 PM, Steven Woody wrote:
> I thing "\x11\x22\x33" in python is not the {0x11, 0x22, 0x33} in C.
> Since, a string in python is immutable, I can _not_ do something like:
> b[1] = "\x55".
>
> And, how about char buf[200] in my original question? The intension
> is to al
"Steven Woody" writes:
> What's the right type to represent a sequence of raw bytes. In C,
> we usually do
>
> 1. char buf[200] or
> 2. char buf[] = {0x11, 0x22, 0x33, ... }
>
> What's the equivalent representation for above in Python?
import array
buf = array.array('b', [0x11, 0x22, ...])
On Sun, Dec 21, 2008 at 10:56 PM, Steven Woody wrote:
> On Mon, Dec 22, 2008 at 10:27 AM, Michiel Overtoom wrote:
>> On Monday 22 December 2008 03:23:03 Steven Woody wrote:
>>
>>> 2. char buf[] = {0x11, 0x22, 0x33, ... }
>>>
>>> What's the equivalent representation for above in Python?
>>
>
Steven Woody wrote:
On Mon, Dec 22, 2008 at 10:27 AM, Michiel Overtoom wrote:
On Monday 22 December 2008 03:23:03 Steven Woody wrote:
2. char buf[] = {0x11, 0x22, 0x33, ... }
What's the equivalent representation for above in Python?
buf="\x11\x22\33"
...
I thing "\x11\x22\x33" in python
On Mon, Dec 22, 2008 at 10:27 AM, Michiel Overtoom wrote:
> On Monday 22 December 2008 03:23:03 Steven Woody wrote:
>
>> 2. char buf[] = {0x11, 0x22, 0x33, ... }
>>
>> What's the equivalent representation for above in Python?
>
buf="\x11\x22\33"
for b in buf: print ord(b)
> ...
> 17
> 3
On Monday 22 December 2008 03:23:03 Steven Woody wrote:
> 2. char buf[] = {0x11, 0x22, 0x33, ... }
>
> What's the equivalent representation for above in Python?
>>> buf="\x11\x22\33"
>>> for b in buf: print ord(b)
...
17
34
27
>>>
Greetings,
--
"The ability of the OSS process to collect and
13 matches
Mail list logo