TypeError: int argument required
mblume at socha.net
Fri Jun 12 08:36:47 EDT 2009
Am Thu, 11 Jun 2009 20:56:24 -0700 schrieb lucius:
> 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
Are you sure that w or h are not returned as strings?
Hint: try this in an interpreter:
print "%d" % (w)
> # this fails, I get "TypeError: int argument required"
> print >> fo, "<rect x=\"%f\" y=\"%f\" width=\"%d\" height=\"%d\"
> opacity:0.9\"/> " % (absX, absY, w, h)
You could simplify such as an expression by writing:
print 'x="%f"' % (x)
More information about the Python-list