On Wed, Apr 29, 2009 at 2:42 PM, Dave Crouse <[email protected]> wrote:
> Trying to print something with a { in it.
> Probably extremely simple, but it's frustrating me. :(
>
> print ('The \"This is a test \" {')
>
> i get this error
>
> ValueError: Single '{' encountered in format string
It works for me:
Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print ('The \"This is a test \" {')
The "This is a test " {
I guess you have redefined print() to use the latest style of string formatting:
http://www.python.org/dev/peps/pep-3101/
Try using double braces {{
Kent
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor