Error confusing a newbie
Keith Dart
kdart at pacbell.net
Sat Dec 11 23:18:55 EST 1999
On Sat, 11 Dec 1999, Wayne Topa wrote:
>
> >| Did you notice that the line numbers are off by one? The open is on line
> >| 6 and not seven. Perhaps your file starts with a newline?
> >|
>
> Give that man a Big Box of cigars.
>
> No, as a matter of fact, I had 'not' noticed. As soon as I deleted the
> first blank line it worked! If you hadn't mentioned it I would not have
> found that. Line 7 was line 7 in vim and I let vim to do the counting.
> Darn, was that stupid of me!!
Interesting. I had a similiar problem once. I once got a script that had
been "tainted" by being on an NT box. It had ^M's at the end of the line.
The latest VIM tries to be "smart", and doesn't show these to you by
default, so I had no idea. The script refused to run, because the OS was
looking for the executable named "/usr/bin/python^M" and couldn't find it.
This is interesting. I put the following in a file and made it executable.
----------------------cut-----------------
echo "This runs!"
----------------------cut-----------------
In Linux, it runs with a shell! It seems Linux defaults to /bin/sh if an
executable text file is executed even without a #! as the "magic" number.
I'm not sure if this is a bug or a feature...
/___\\|//__////
\ (+ +) \\\\
-- --------------------oOOo~(_)~oOOo----------------------------------------
Keith Dart
<mailto:kdart at techie.com>
<http://www.employees.org/~kdart/>
============================================================================
More information about the Python-list
mailing list