Thanks for that, i see now. However it doesn't solve my problem. Is there a way to force it to return a decimal when whole numbers are supplied?
I'm using the python image library (http://www.pythonware.com/library/ pil/handbook/image.htm) to resize some images, and the size of those images is returned as a whole number. I want to find the ratio (w/h || h/w) so i can resize the image so the smallest side is greater than a given number. an_image = Image.open("image_path...") dimensions = an_image.size # example: dimension = 300, 500 ratio = dimensions[0]/dimensions[1] return ratio On Jun 15, 9:49 pm, Sebastian Bauer <[EMAIL PROTECTED]> wrote: > size = [200.0, 400.0] > return size[0]/size[1] > > Jarred Bishop pisze: > > > Hi, this is driving me crazy. I'm sure there is a VERY simple solution > > but can't seem to find it. thanks for you help. > > > if I have > > > size = 200, 400 > > return size[0]/size[1] > > > it returns '0'. which isnt much help. how do i get '0.5' or '.5' ? > > > Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---