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


Groups > comp.lang.python > #106952

Re: IdentationError; unexpected indent

From Igor Korot <ikorot01@gmail.com>
Newsgroups comp.lang.python
Subject Re: IdentationError; unexpected indent
Date 2016-04-13 12:02 -0400
Message-ID <mailman.80.1460563342.15650.python-list@python.org> (permalink)
References <CABcnvxeMTSBd7EpjpiguRovHebn13N71KcxvJmuik1qfM7Rn1w@mail.gmail.com> <CA+FnnTyDm2E4W7HGR9EOew4v8fTUm7h+7f5T7+7GegWxkO5GbA@mail.gmail.com>

Show all headers | View raw


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

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


Thread

Re: IdentationError; unexpected indent Igor Korot <ikorot01@gmail.com> - 2016-04-13 12:02 -0400

csiph-web