Linux.com: Python 3 makes a big break

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Sun Oct 19 03:43:28 EDT 2008


In message
<deb99bf0-c418-4f18-823a-8b9f2e4c5cc0 at g61g2000hsf.googlegroups.com>, Kay
Schluehr wrote:

> If someone had solved the hard problem of finding a less
> cumbersome way of writing sys.stdout.write(...) ...

I don't see what the big deal is. I regularly write things like

   sys.stdout.write \
      (
            "<INPUT TYPE=\"RADIO\" NAME=\"%(name)s\""
            " ID=\"%(name)s[%(value)s]\" VALUE=\"%(value)s\"%(checked)s>"
            "<LABEL FOR=\"%(name)s[%(value)s]\">%(title)s</LABEL>\n"
              # using LABEL lets user click on text to select button
        %
          {
            "name" : EscapeHTML(Name),
            "value" : EscapeHTML(Value),
            "title" : Title,
            "checked" : ("", " CHECKED")[Checked],
          }
      )




More information about the Python-list mailing list