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

When I run the following command:
[EMAIL PROTECTED] 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.



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to