Hi Luigi,

>> > > os.popen3() does not seem to support the read()-method?
...
>> >>> os.popen3( ocr_cmd ).read()
>> __main__:1: RuntimeWarning: tp_compare didn't return -1 or -2 for exception
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in <module>
>> AttributeError: 'tuple' object has no attribute 'read'

> ok. this is the problem. popen returns 3 files descriptor
> you have to use something like:

> fin, fout, ferr = os.popen3(cmd)
> fout.read()

Oh, this is an array :) I missed that:

>>> # os.popen3() returns [stdin, stdout, stderr]
>>> os.popen3( ocr_cmd )[1].read()

'- Unlo_k Arhus -\n\n'

Yes, you're right, that's working and probably under win9x aswell.
I'll test and let you know later.



Happy coding :)
   
Vibe
_______________________________________________
[email protected]
http://mail.python.org/mailman/listinfo/spambayes
Check the FAQ before asking: http://spambayes.sf.net/faq.html

Reply via email to