[Tutor] broken script - curiouser and curiouser
Lisi
lisi.reisz at gmail.com
Thu Jul 7 12:15:23 CEST 2011
On Thursday 07 July 2011 10:21:59 Walter Prins wrote:
> Hi Lisi
>
> On 7 July 2011 08:52, Lisi <lisi.reisz at gmail.com> wrote:
> > > > You could obviously see something wrong
> > >
> > > The posted error report had no colon.
> >
> > Yes - but the script had one, which was why I included the actual script
> > in my
> > original post. I seem to have cut too much in this email!
>
> The error message from Python is quoting what the interpreter read/saw from
> the script file it was running. If it quoted no colon, then there was no
> colon in the python file read by the interpreter, at the time that it tried
> to run it. Your job is to figure out how this has happened. Do you maybe
> have several copies of the script lying around in different folders?
No. KWrite keeps an automatic backup, but I never use it. As a result of
your question, I have just run the automatic backup. It runs fine.
> Were
> you maybe editing the the file (and keeping it open in the editor) while
> running it from a command prompt every so often and did you maybe not save
> the change before running the script
I did do that once or twice during the long saga, but immediately realised and
saved the file before running again. In fact, I think that it must sometimes
have been saved multiple times because I was so afraid that I would do that.
> (so that there may have been a
> discrepancy between the script on disk that was run by the interpreter and
> the script in your editor window)?
I can see nothing that could have caused it. :-( Believe me, I thought of all
the possibilities that have been mentioned so far and tried them out, with no
joy. The only thing that worked was inserting a space and then, at Alan's
suggestion, removing it. I am completely baffled. There must have been
something, but I cannot fathom what. What difference does inserting a space
and then deleting it make?????
At least this confirms that I took all the right debugging steps. I think I
just have to write it down as one of life's little mysteries. If I can't
uncover what happened with the files in front of me, clearly people who can
see neither the screen nor the files have an impossible task!
I am very grateful for all the list's help. I may have been left with the
puzzle, but I have learnt a lot in the process of trying to debug the script.
Lisi
More information about the Tutor
mailing list