[Tutor] line numbering program discloses shebang screw!
Gerrit Holl
gerrit@nl.linux.org
Sun May 18 04:18:02 2003
Kirk Bailey schreef op zondag 18 mei om 09:18:19 +0000:
> I am running 1.5.2 until the server upgrade later on next month. Could
> someone running version 2+ please see if they can kill a script this way?
It's the same:
10:13:58:2:gerrit@stopcontact:/tmp$ ./hello.py
/usr/bin/python: can't open file '# 1'
10:13:59:2:gerrit@stopcontact:/tmp$ cat hello.py
#!/usr/bin/python # 1
print "Hello, world!" # 2
I'm not sure whether Python can do anything against this.
I don't think it can.
> Seems I ought to write a program to look for tabs and count them and make
> adjustments accordingly?
Aren't you just looking for tabnanny?
tabnanny -- Detection of ambiguous indentation
For the time being this module is intended to be called as a script.
However it is possible to import it into an IDE and use the function
check() described below.
Warning: The API provided by this module is likely to change in future
releases; such changes may not be backward compatible.
yours,
Gerrit.
--
165. If a man give to one of his sons whom he prefers a field, garden,
and house, and a deed therefor: if later the father die, and the brothers
divide the estate, then they shall first give him the present of his
father, and he shall accept it; and the rest of the paternal property
shall they divide.
-- Hammurabi, Code of Law
--
Asperger Syndroom - een persoonlijke benadering:
http://people.nl.linux.org/~gerrit/
Het zijn tijden om je zelf met politiek te bemoeien:
http://www.sp.nl/