Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #106998 > unrolled thread
| Started by | Joel Goldstick <joel.goldstick@gmail.com> |
|---|---|
| First post | 2016-04-14 09:07 -0400 |
| Last post | 2016-04-14 09:07 -0400 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: IdentationError; unexpected indent Joel Goldstick <joel.goldstick@gmail.com> - 2016-04-14 09:07 -0400
| From | Joel Goldstick <joel.goldstick@gmail.com> |
|---|---|
| Date | 2016-04-14 09:07 -0400 |
| Subject | Re: IdentationError; unexpected indent |
| Message-ID | <mailman.105.1460639237.15650.python-list@python.org> |
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 top | Article view | comp.lang.python
csiph-web