Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Thanks, I appreciate it. I think I got a little over-zealous in escaping my %s.

Interestingly, in Python, "%%%s" % "foo" != "%%foo"



It works just like \ in standard unix parsing - you escape the escape character by doubling it. So in "%%%s":

  "%%" -> "%"
  "%s" -> "foo"
for a result of "%foo".


Right, but the escaping by doubling does not work in Python unless it's in a format string. So "%%foo" does not count as escaped. That's what threw me off.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: