quote: Original post by nano
I got errors that were telling me that thoe characters were invalid, but I guess someinth else caused it. The percent character is however causing problems, so I have to change
all % as %%.
You do know what the % is for, right? It works somewhat like the C printf:
print "Hello %s" % "world"
If you need multiple parameters, you need to use a sequence:
print "Hello %s from %s" % ( "world", "norway" )
The syntax I used above is an extension of that, allowing you to use named parameters in conjunction with a dictionary:
print "Hello %(to)s from %(from)s" % { "to" : "world", "from" : "Norway" }
It is very useful when you use it with the locals() function, which returns a dictionary of all local variables.
quote:
Wow, I thought the triple-quoted strings were only useful as docstrings. I never saw anything like this in the documentation.
I think Guido''s tutorial covers it.
AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.