S
stephen
Hi all. How do I escape the "%" sign in a print statement so that it
prints? Thanks.
Stephen
prints? Thanks.
Stephen
Hi all. How do I escape the "%" sign in a print statement so that it
prints? Thanks.
%Hi all. How do I escape the "%" sign in a print statement so that it
prints? Thanks.
Hi all. How do I escape the "%" sign in a print statement so that it
prints? Thanks.
wrote in in
comp.lang.python:
print "%%"
Thanks -- a percent escapes itself when using %-formatting.
Stephen
1. Reasoning: How do you get a literal "'" into an SQL string constant?
How do you get a literal "\" into a Python string constant? How do you
get a literal "$" into some *x shell command lines? Do you detect a
pattern?
Lawrence said:None of which applies to escaping of % characters in format strings.
Lawrence said:None of which applies to escaping of % characters in format strings.
What I had in mind was:
where surname = 'O''REILLY'
install_dir = "C:\\Python25"
...
print "The interest rate is %.2f%% p.a." % (rate * 100.0)
the common pattern being that the problem character is doubled.
Lawrence said:Which doesn't apply to the "$" character in *nix shell command lines.
John said:I'll take your word for it; it's been quite a while *Something* in
the dim dark past worked like that
Fredrik said:makefiles?
"""From the docs for GNU Make:
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.