Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #83472
| Return-Path | <davea@davea.name> |
|---|---|
| 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 <davea@davea.name> |
| 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> <m8mv27$k6e$2@dont-email.me> <m8nfs8$k6e$3@dont-email.me> <1ae2a5c4-78ae-4831-ac01-b886e92c0468@googlegroups.com> <mailman.17538.1420827512.18130.python-list@python.org> <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 <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.17543.1420842214.18130.python-list@python.org> (permalink) |
| 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 |
Show key headers only | View raw
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, <semeon...@gmail.com> 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 <module>
> 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
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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