unsigned char array -> buffer

Henri Schomaecker hs at byteconcepts.de
Mon Oct 18 18:04:53 CEST 2004


Hi again,

as I already wrote, I'm trying to get image binary data into a var holding
an unsigned char string and then print it directly to the browser.
I now already did some tries with an array and now found the buffer()
function. - I thought I would have the solution now and also changed stdout
to O_BINARY, but still I don't get the data right:

8<--------8<--------8<--------8<--------8<--------

imgObj = win32com.client.Dispatch("mine.imgsender")
myImgData = buffer(imgObj.getImgData())

msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
sys.stdout.write(myImgData)

8<--------8<--------8<--------8<--------8<--------

I'm really lost and would be very thankful if someone could help me with
that.

Many thanks in advance,
    yours Henri

-- 
| Henri Schomäcker - BYTECONCEPTS, VIRTUAL HOMES
|     Datendesign für Internet und Intranet
|         http://www.byteconcepts.de
|         http://www.virtual-homes.de



More information about the Python-list mailing list