Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'operator': 0.03; 'string.': 0.05; 'float': 0.07; 'string': 0.09; '40,': 0.09; 'arguments': 0.09; 'converted': 0.09; 'formatting': 0.09; 'friday,': 0.09; 'repeated': 0.09; 'strings.': 0.09; 'subject:files': 0.09; 'subject:using': 0.09; 'def': 0.12; 'jan': 0.12; 'mostly': 0.14; '......': 0.16; 'subject:Generate': 0.16; 'typeerror:': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'error': 0.23; 'errors.': 0.24; 'orientation': 0.24; 'looks': 0.24; 'skip:" 30': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'subject:) ': 0.29; 'skip:g 30': 0.30; "i'm": 0.30; 'code': 0.31; 'getting': 0.31; '>>>>': 0.31; 'informative': 0.31; 'file': 0.32; 'lists': 0.32; 'probably': 0.32; 'supposed': 0.32; '(most': 0.33; 'checking': 0.33; 'entirely': 0.33; 'fri,': 0.33; 'subject: (': 0.35; 'something': 0.35; 'but': 0.35; 'add': 0.35; 'should': 0.36; 'error.': 0.37; 'january': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'recent': 0.39; 'to:addr:python.org': 0.39; 'skip:u 10': 0.60; 'till': 0.61; 'new': 0.61; "you're": 0.61; "you've": 0.63; 'email addr:gmail.com': 0.63; 'more': 0.64; 'different': 0.65; 'received:74.208': 0.68; '.....': 0.78; '180': 0.84; '2015': 0.84; 'joel': 0.91; 'mistakenly': 0.91 Date: Fri, 09 Jan 2015 17:23:19 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Generate jpg files using line length (pixels) and orientation (degrees) References: <0f51bd21-7b0a-4ea0-8b13-27b1967d3b41@googlegroups.com> <1ae2a5c4-78ae-4831-ac01-b886e92c0468@googlegroups.com> <6356e045-835c-4b87-bdce-59c8f3d8bc2c@googlegroups.com> In-Reply-To: <6356e045-835c-4b87-bdce-59c8f3d8bc2c@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:GtkzcCoY55C4KFfJEHzjv4rUPjXKP6gBJNgZ/+IUbqp R+3MaY/HzLYEk0PBTf5ssV3kyof/1uHQ9vFt4uJLmCz2ttxVSY JCg+jYUryb/bn/A4T2M1jVhfiyZR1kTi/ny2BbFUtTSTKpWdBF OaUWlsoQIlq9f338o65/QQ8brj/EsQtF+EyeD9F/FBFn48Vmr4 5jT7z9cwLKCEozfiqtXN3OHBAR6lj1CanHfdkrtWNFvHmHSkt+ 2Za8sdHAh6ObygoXr8fuzHqRvfqxzTT9JmI1wHx0+IJsFiku/c 7G1eMxj2TcFSFKnn4Fakw2lVHk1d3ZL9XMktWbYfcOI9ikxTpQ smsvGULGZ04C7lAs6g9c= X-UI-Out-Filterresults: notjunk:1; X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 58 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1420842214 news.xs4all.nl 2926 [2001:888:2000:d::a6]:41915 X-Complaints-To: abuse@xs4all.nl Path: csiph.com!usenet.pasdenom.info!bete-des-vosges.org!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:83472 On 01/09/2015 04:51 PM, semeon.risom@gmail.com wrote: > On Friday, 9 January 2015 12:18:46 UTC-6, Joel Goldstick wrote: >> On Fri, Jan 9, 2015 at 12:49 PM, wrote: (double-spaced nonsense mostly trimmed) >> >> i = 0 >> a = [] >> b = [] What are a and b supposed to contain? Please use more informative names for them. it looks like they are intended to be lists of floats, but you're then stuffing them with strings. >> for row in rdr: >> a.append(row[0]) >> b.append(row[1]) perhaps something like: a.append(float(row[0])) b.append(float(row[1])) >> >> def makeimg(length, orientation): Probably should add some type checking here, since you're having repeated errors. if type(length) not is float or type(orientation) not is float: ..... some educational error message showing what the types and values actually are..... Note I'm NOT recommending you code it this way. Just add the check till you've narrowed down the errors. >> >> >> >> ..... > Unfortunately getting a new error. > > Traceback (most recent call last): > File "C:\Users\Owner\Desktop\Stimuli Generation\Coordinates\Generate_w corr.py", line 68, in > makeimg(length, orientation) > File "C:\Users\Owner\Desktop\Stimuli Generation\Coordinates\Generate_w corr.py", line 40, in makeimg > orientation = orientation % 180 > TypeError: not all arguments converted during string formatting >>>> I think that's because the % operator means an entirely different thing if orientation is mistakenly passed as a string. -- DaveA