<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 5/7/2008 10:49 PM, Stefan Behnel wrote:
<blockquote cite="mid:48229471.1020608@behnel.de" type="cite">
  <pre wrap="">Hi,

Brad Schick wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Maybe I'd be better off using python strings
with  PyString_FromStringAndSize and friends?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Yes.
  </pre>
</blockquote>
<br>
I guess strings a byte arrays is part of pre 3.0 python. It just seems
so ugly in what is otherwise a fairly clean language. Particularly when
the data sometimes starts life as a list. How do you go about stuffing
'bytes' into a string? With arrays as below? Or with cStringIO? Yuck
and yuck ;)<br>
<br>
data = [0,1,2,3,4,5,6,7]<br>
arr = array.array('B', data)<br>
str = arr.tostring()<br>
<br>
<br>
-Brad
</body>
</html>