How do I handle #

Felipe Almeida Lessa felipe.lessa at gmail.com
Sat Mar 25 01:56:38 CET 2006


Em Sáb, 2006-03-25 às 00:46 +0000, Michael Sperlle escreveu:
> I need to write out a file containing the # comment. When I try to specify
> it as part of a literal, everything afterward turns into a comment.

$ python
Python 2.3.5 (#2, Mar  6 2006, 10:12:24)
[GCC 4.0.3 20060304 (prerelease) (Debian 4.0.2-10)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print "hi # hi"
hi # hi
>>> print 'hi # hi'
hi # hi
>>> print r"hi # hi"
hi # hi
>>> print u"hi # hi"
hi # hi

What's up?

-- 
Felipe.




More information about the Python-list mailing list