Thursday, August 29, 2013

Re: else: invalid syntax

On 2013-08-29, at 5:33 AM, Nagarajan Dharmar Sitha <nagarajan.dharmarsitha@gmail.com> wrote:

> if (os.stat('udacityLastFileNumberForL.txt').st_size == 0):
> MaxNumberFile = open("udacityLastFileNumberForL.txt", "w")
> self.udacityFileVersionNumberL = 1
> MaxNumberFile.write("DATA_VERSION_CONSTANT_M: %s" % self.udacityFileVersionNumberL)
> MaxNumberFile.close()
> else:
> MaxNumberFile = open('udacityLastFileNumberForL.txt', "r")
> for LastFileNumber in MaxNumberFile.readlines():
>
>
> it show error:
>
> else:
> ^
> SyntaxError: invalid syntax
>
> Kindly help me for debug this

It looks like your indenting might be off. The "else" must line up exactly with the "if".

hth

- Tom

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment