Format strings that contain '%'

R

rick_muller

I'm trying to do something along the lines of
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ValueError: unsupported format character 't' (0x74) at index 1

although, obviously I can't do this, since python thinks that the '%t'
is a format string.

I've tried obvious permutations like

which also doesn't work.

For (template) reasons, I can't do

Will anything else work here?
 
E

Erik Max Francis

I'm trying to do something along the lines of

Traceback (most recent call last):
File "<stdin>", line 1, in ?
ValueError: unsupported format character 't' (0x74) at index 1

Use %%:
'%temp 1'
 

Ask a Question

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.

Ask a Question

Members online

Forum statistics

Threads
474,001
Messages
2,570,255
Members
46,856
Latest member
MyronKatz6

Latest Threads

Top