[Tutor] os.popen, xp

Coen van der Kamp coen at reservoir.nl
Sun Nov 19 11:54:08 CET 2006


Luke Paireepinart wrote:
> Coen van der Kamp wrote:
>> Hello,
>> I've got a problem with the following code:
>>
>> import os, sys, string
>> mycolors = os.popen("coloryze --monochromatic --total=6 
>> &").read().rstrip()
>> print mycolors
>>
>> This works fine on OS X, but when i tried it on XP the only result 
>> was an empty string. When I run coloryze from the promt
> when you run it from which prompt?
> The OS X one or the XP one?
XP.

I did set a Path to coloryze: C:\Python\Lib\coloryze.py (my computer, 
advanced, system variable, user variable). So i could run coloryze form 
the XP prompt. I now realize that it is maybe not smart to access 
another python program this way,... But since typing 'coloryze 
--monochromatic --total=6 ' running from the prompt worked, I'd think 
that the same should be possible from Python. Hope you can help me out!

>>  the return is a nice list of colors. So coloryze works. What am I 
>> missing here?
>>
>> Coen.
>>
>>
>>
>> _______________________________________________
>> Tutor maillist  -  Tutor at python.org
>> http://mail.python.org/mailman/listinfo/tutor
>>
>>   
>
>



More information about the Tutor mailing list