Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #106998
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Joel Goldstick <joel.goldstick@gmail.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: IdentationError; unexpected indent |
| Date | Thu, 14 Apr 2016 09:07:14 -0400 |
| Lines | 111 |
| Message-ID | <mailman.105.1460639237.15650.python-list@python.org> (permalink) |
| References | <CABcnvxeMTSBd7EpjpiguRovHebn13N71KcxvJmuik1qfM7Rn1w@mail.gmail.com> <CA+FnnTyDm2E4W7HGR9EOew4v8fTUm7h+7f5T7+7GegWxkO5GbA@mail.gmail.com> <CABcnvxdJ84ZpYy688ZqhPCRY3OpW2vh5OaiUpM9+cTLT9eHS8A@mail.gmail.com> <CA+FnnTzTMk6MYTRZqkOUJmx3YCg8uoV87wowFiq2=1WrV_-X0A@mail.gmail.com> <CAPM-O+xai4488nNfS6w0ifN6fC_6XDu7HR1HEW_wZgt+dFaJPw@mail.gmail.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| X-Trace | news.uni-berlin.de KrI4GOUr3w95dJ8pedAIMg4L5SNiKiakn+BsqU6A/gWQ== |
| Return-Path | <joel.goldstick@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.001 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'sys': 0.05; 'f.close()': 0.07; 'cc:addr:python-list': 0.09; '"r")': 0.09; 'editor.': 0.09; 'loop.': 0.09; 'statements': 0.09; 'unexpected': 0.09; 'received:209.85.218': 0.10; 'url:blog': 0.10; 'python': 0.10; 'wed,': 0.15; 'thu,': 0.15; "'*'": 0.16; '17:02': 0.16; '2016': 0.16; 'dist': 0.16; 'exactly?': 0.16; 'f.read()': 0.16; 'igor': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'tabs': 0.16; 'wrote:': 0.16; '>>>': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; '(see': 0.20; 'please?': 0.22; 'skip:* 50': 0.22; 'am,': 0.23; 'appears': 0.23; 'code,': 0.23; 'advance.': 0.23; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'script': 0.25; 'error': 0.27; 'message-id:@mail.gmail.com': 0.27; '14,': 0.27; 'executing': 0.27; 'correct': 0.28; 'skip:( 20': 0.28; '13,': 0.29; 'symbols': 0.29; 'code:': 0.29; 'print': 0.30; 'url:mailman': 0.30; 'code': 0.30; "i'd": 0.31; 'run': 0.33; 'url:python': 0.33; 'closely': 0.33; 'url:listinfo': 0.34; 'skip:d 20': 0.34; 'list': 0.34; 'received:google.com': 0.35; 'displays': 0.35; 'something': 0.35; 'but': 0.36; 'should': 0.36; 'url:org': 0.36; 'received:209.85': 0.36; 'subject:: ': 0.37; 'skip:s 50': 0.37; 'received:209': 0.38; 'skip:p 20': 0.38; 'thank': 0.38; 'hi,': 0.38; 'why': 0.39; 'url:mail': 0.40; 'your': 0.60; 'you.': 0.64; 'response.': 0.66; 'fact,': 0.67; 'url:info': 0.71; '2.7.': 0.84; 'edge,': 0.84; 'to:none': 0.91; '*for': 0.91; 'joel': 0.91; 'subject:; ': 0.91; 'you...': 0.97 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc; bh=Hd5NVRUMv4HwLb3wqr6ziWsc/+BM/IQC+bn4/gfwuTw=; b=C+i5eReo5mJJWLUiMG43O7ln6UBTsrC2oRZfXvtsSPF3rXIaNtPQSMyogX4fZGqwcR PqV5453g5Vnii1+CiWoidcrycS5MfoX8XVAeTsuvZBOnj0+U+7622uce81jOfnhPBzh3 vPg7BO/ak8bcwiQ/DCqhm4R1OdXI2syAWwRoHYhgySjtJNsJuYPDYTGY+SxK54ojxnRL kIhOkp0224Nyj5Vwjyvy3IAE0Ih2zHbiD8Omd5h/+I2yoi4gLtFU9sEsEB/EWQxJy4NH TSDUCPDcTdlD0sjFFPhmj4/WCLRlapZkiOwUJRA6DSm4+cqNWlQPXVgdj+IwslA/x7HY stlg== |
| X-Google-DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc; bh=Hd5NVRUMv4HwLb3wqr6ziWsc/+BM/IQC+bn4/gfwuTw=; b=XlW2p+Vak2HX92UGHXoaJZFTSIOYCBlPjnbfHKY4GEh/YnKchrl1V/qIvm1OhOjSIT tH9n0qQFyNKlGC2ORRF2ubMHiiKrjUoV5D8ckGr+rjYpmFZHmjeWjiCb3uI4+aRYU29v QCGE9drjGmVKCOP1/1uUJNVxn7bwqjw8pBofSCpUM2Wk2MzfNqnlemg5ak85pd3UqAhi aqqQCdsXnRwRYi0WIQ0srWsmrgfsqtaabVyPHCJAfcueo02tvM67pM9dIq+VGSpVrMVY ZvNlKbEZ05UoFsYyC8DYzQEGE4jLyaSosucvaWiIMN+c16lfTHbkhalL02WBup/dnG6N 6b3Q== |
| X-Gm-Message-State | AOPr4FUojDJ7MWGVQ1zA+jCUPsr3wgpAy6tGU2QrcnV4TN4FY2hRvk0SMPYTb5DTxTtJM3DeWP12P/v3vAjvEg== |
| X-Received | by 10.202.204.130 with SMTP id c124mr7360155oig.112.1460639234705; Thu, 14 Apr 2016 06:07:14 -0700 (PDT) |
| In-Reply-To | <CA+FnnTzTMk6MYTRZqkOUJmx3YCg8uoV87wowFiq2=1WrV_-X0A@mail.gmail.com> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.21 |
| 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> |
| X-Mailman-Original-Message-ID | <CAPM-O+xai4488nNfS6w0ifN6fC_6XDu7HR1HEW_wZgt+dFaJPw@mail.gmail.com> |
| X-Mailman-Original-References | <CABcnvxeMTSBd7EpjpiguRovHebn13N71KcxvJmuik1qfM7Rn1w@mail.gmail.com> <CA+FnnTyDm2E4W7HGR9EOew4v8fTUm7h+7f5T7+7GegWxkO5GbA@mail.gmail.com> <CABcnvxdJ84ZpYy688ZqhPCRY3OpW2vh5OaiUpM9+cTLT9eHS8A@mail.gmail.com> <CA+FnnTzTMk6MYTRZqkOUJmx3YCg8uoV87wowFiq2=1WrV_-X0A@mail.gmail.com> |
| Xref | csiph.com comp.lang.python:106998 |
Show key headers only | View raw
On Thu, Apr 14, 2016 at 8:04 AM, Igor Korot <ikorot01@gmail.com> wrote:
> Salma,
>
> On Thu, Apr 14, 2016 at 3:28 AM, salma ammar <ammarsalma118@gmail.com> wrote:
>> Hi Igor,
>>
>> thank you very much for your response. In fact, I put the code in bold, that
>> is why it displays those symbols.
>> This is the code:
>>
>> import sys
>> sys.path.append('C:/Users/user/src/sumo-0.22.0/tools')
>> import sumolib
>> net =
>> sumolib.net.readNet("C:/Users/user/src/sumo-0.22.0/tools/sumolib/net/qgislyonvelo.net.xml")
>> radius = 0
>> f = open("C:/fichierstationsvelos.txt", "r")
>> contenu = f.read()
>> print(contenu)
look closely at this for loop. Print and edges don't line up with the
other statements
>> for id, lat, lon in f:
>> x, y = net.convertLonLat2XY(lon, lat)
>> print(x, y)
>> edges = net.getNeighboringEdges(x, y, radius)
>> print (edges)
>> while len(edges) == 0:
>> radius = radius + 10
>> edges = net.getNeighboringEdges(x, y, radius)
>> distancesAndEdges = sorted([(dist, edge) for edge, dist in edges])
>> print(distancesAndEdges)
>> edgeofstation[id] = distancesAndEdges[0]
>> print (edgeofstation[id])
>> f.close()
>
> And what is the error message exactly? Can you copy/paste it as well?
>
> Also, I'd advise you to subscribe to the list so that other people can
> help you...
>
> Thank you.
>
>>
>>
>> Cordially.
>>
>> 2016-04-13 17:02 GMT+01:00 Igor Korot <ikorot01@gmail.com>:
>>>
>>> Hi, Salma,
>>>
>>> On Wed, Apr 13, 2016 at 11:53 AM, salma ammar <ammarsalma118@gmail.com>
>>> wrote:
>>> > Hi,
>>> >
>>> > I am about to run this code using python 2.7. But when executing this
>>> > code,
>>> > an error appears (see attachement): IdentationError; unexpected indent
>>> >
>>> > What should I rectify to correct this error please?
>>> >
>>> >
>>> > *import sys*
>>> > *sys.path.append('C:/Users/user/src/sumo-0.22.0/tools')*
>>> > *import sumolib*
>>> > *net =
>>> >
>>> > sumolib.net.readNet("C:/Users/user/src/sumo-0.22.0/tools/sumolib/net/qgislyonvelo.net.xml")*
>>> > *radius = 0*
>>> > *f = open("C:/fichierstations.txt", "r")*
>>> >
>>> > *contenu = f.read()*
>>> >
>>> > *print(contenu)*
>>> > *for id, lat, lon in f:*
>>> > * x, y = net.convertLonLat2XY(lon, lat)*
>>> > * print(x, y)*
>>> > * edges = net.getNeighboringEdges(x, y, radius)*
>>> > * print (edges)*
>>> > * while len(edges) == 0:*
>>> > * radius = radius + 10*
>>> > * edges = net.getNeighboringEdges(x, y, radius)*
>>> > * distancesAndEdges = sorted([(dist, edge) for edge, dist in edges])*
>>> > * print(distancesAndEdges)*
>>> > * edgeofstation[id] = distancesAndEdges[0]*
>>> > * print (edgeofstation[id])*
>>> > *f.close()*
>>>
>>> What are those '*' symbols in the e-mails?
>>> Are they hard tabs or something else?
>>>
>>> Please copy and paste the script from the editor.
>>>
>>> Thank you.
>>>
>>> >
>>> >
>>> > Thank you in advance.
>>> > --
>>> > https://mail.python.org/mailman/listinfo/python-list
>>
>>
> --
> https://mail.python.org/mailman/listinfo/python-list
--
Joel Goldstick
http://joelgoldstick.com/blog
http://cc-baseballstats.info/stats/birthdays
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: IdentationError; unexpected indent Joel Goldstick <joel.goldstick@gmail.com> - 2016-04-14 09:07 -0400
csiph-web