Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #83560

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

Date 2015-01-11 15:16 -0500
From Dave Angel <davea@davea.name>
Subject Re: Generate jpg files using line length (pixels) and orientation (degrees)
References (1 earlier) <m8mv27$k6e$2@dont-email.me> <m8nfs8$k6e$3@dont-email.me> <1ae2a5c4-78ae-4831-ac01-b886e92c0468@googlegroups.com> <m8sgai$k48$1@dont-email.me> <70bd0c94-9336-4ab2-adc0-3fd93af25e2d@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.17592.1421007429.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 01/11/2015 02:41 PM, semeon.risom@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@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

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Generate jpg files using line length (pixels) and orientation (degrees) semeon.risom@gmail.com - 2015-01-08 09:09 -0800
  Re: Generate jpg files using line length (pixels) and orientation (degrees) Denis McMahon <denismfmcmahon@gmail.com> - 2015-01-08 22:07 +0000
    Re: Generate jpg files using line length (pixels) and orientation (degrees) Denis McMahon <denismfmcmahon@gmail.com> - 2015-01-09 02:54 +0000
      Re: Generate jpg files using line length (pixels) and orientation (degrees) semeon.risom@gmail.com - 2015-01-09 09:49 -0800
        Re: Generate jpg files using line length (pixels) and orientation (degrees) Joel Goldstick <joel.goldstick@gmail.com> - 2015-01-09 13:18 -0500
          Re: Generate jpg files using line length (pixels) and orientation (degrees) semeon.risom@gmail.com - 2015-01-09 13:51 -0800
            Re: Generate jpg files using line length (pixels) and orientation (degrees) Dan Sommers <dan@tombstonezero.net> - 2015-01-09 22:21 +0000
            Re: Generate jpg files using line length (pixels) and orientation (degrees) Dave Angel <davea@davea.name> - 2015-01-09 17:23 -0500
            Re: Generate jpg files using line length (pixels) and orientation (degrees) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-01-09 22:41 +0000
        Re: Generate jpg files using line length (pixels) and orientation (degrees) Denis McMahon <denismfmcmahon@gmail.com> - 2015-01-11 00:32 +0000
          Re: Generate jpg files using line length (pixels) and orientation (degrees) semeon.risom@gmail.com - 2015-01-11 11:41 -0800
            Re: Generate jpg files using line length (pixels) and orientation (degrees) Denis McMahon <denismfmcmahon@gmail.com> - 2015-01-11 19:56 +0000
            Re: Generate jpg files using line length (pixels) and orientation (degrees) Dave Angel <davea@davea.name> - 2015-01-11 15:16 -0500

csiph-web