Generate jpg files using line length (pixels) and orientation (degrees)

Dave Angel davea at davea.name
Sun Jan 11 15:16:58 EST 2015


On 01/11/2015 02:41 PM, semeon.risom at gmail.com wrote:
> On Saturday, 10 January 2015 21:31:25 UTC-6, Denis McMahon  wrote:

>> # using lists of values
>> for length in a:
>>      for orientation in b:
>>          makeimg(length, orientation)
>>
>> --
>> Denis McMahon, denismfmcmahon at gmail.com
>
> The code is working correctly. Thank you! The only change I had to make was referring to it as a float instead of an integer.
>
> The images are generating, however I'm noticing that it's making an image for every possible pair in each list (i.e. Image 1: a1 and b1; Image 2: a1 and b2; Image 3: a1 and b3....) instead of an image for each row (e.g. Image 1: a1 and b1; Image 2: a2 and b2; Image 3: a3 and b3...).
>

The minimum change for that would be to zip the lists together:

for length, orientation in zip(a,b):
     makeimg(length, orientation)


-- 
DaveA



More information about the Python-list mailing list