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

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
KetoBurn
Top