ImageMagick Issue

Michael Bentley michael at jedimindworks.com
Thu May 31 00:36:32 EDT 2007


On May 30, 2007, at 11:00 PM, Sick Monkey wrote:

> When I run the following command:
> ozdon at SickCodeMonkey david.huggins]# identify -format %w '/someDIR/ 
> images/david.huggins/100_0264.JPG'
>
> I get the following result
> 2304
>
> --------------------
> However, when I try to set this value to a variable, ie
> w= os.system("identify -format %w '/someDIR/images/david.huggins/ 
> 100_0264.JPG'")
> print w
>
> I get
> TypeError: argument 1 must be string or read-only buffer, not int

The return value of os.system() is the exit status of the command it  
runs.  You are looking for its output, instead of exit status.  To  
get at its output, use the subprocess module http://www.python.org/ 
doc/current/lib/module-subprocess.html

hth,
Michael
---
Let the wookie win.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070530/0a341c19/attachment.html>


More information about the Python-list mailing list