TypeError: int argument required

lucius lucius.fox08 at gmail.com
Thu Jun 11 23:56:24 EDT 2009


I am trying to
print some values to a file (using c's printf like method).
TypeError: int argument required
# this works, i see value on screen
 print  w, h, absX, absY

# where result is the return value of my regular expression.

  w, h, absX, absY = result.group(3), result.group(4), result.group
(5), result.group(6)

w = 100
h = 200

absX = 10.0
absY = 20.0

# this fails, I get "TypeError: int argument required"
	   print >> fo, "<rect x=\"%f\" y=\"%f\" width=\"%d\" height=\"%d\"
style=\"fill:blue;stroke:pink;stroke-width:5;fill-opacity:0.1;stroke-
opacity:0.9\"/> " % (absX, absY, w, h)

Thank you for any help.



More information about the Python-list mailing list