[Tutor] wierd error in comment string

Alan Gauld alan.gauld at blueyonder.co.uk
Sun Apr 25 15:10:41 EDT 2004


> I have a comment at the start of some experimental code ...
>       1 #!/usr/bin/env python

THis is a comment

>       2
>       3 """
>       4 ...... blah blah
>       5 ....... blah blah
>       6

This is a documentation string stored as the __doc__ variable
for the module.

> sys:1: DeprecationWarning: Non-ASCII character '\xa3' in file
> ./ftseloggerv2.py on line 9, but no encoding declared; see
> http://www.python.org/peps/pep-0263.html for details

So Python correctly tells you that you are storing a strangeness.

> I looked up the web page .... got confused. I thought all characters
> inside """...""" were ignored ?

No, they are not ignored they are stored as the doc string.
As such they act like a comment, but one which is available
at run time...

> Can anyone tell me in simple speak what has gone wrong ? :-\

Change it to a true comment (# at all the line starts)
or make the string unicode.

HTH

Alan G.




More information about the Tutor mailing list