Invalid format character in string

Skip Montanaro skip at pobox.com
Fri Apr 4 16:59:48 EST 2003


    Nikolai> ... since the text is actually a HTML file, it may contain a
    Nikolai> lot of characters with % (typically cell width definitions of
    Nikolai> tables).  If these are contained in the file, the string format
    Nikolai> statement complains about illegal format character.  

Just double any literal % characters, e.g.:

    <table width="%(width)s%%">

Skip





More information about the Python-list mailing list