> > On 9/6/05, Barry Warsaw <barry at python.org> wrote: > > > printf('$1 forgot to frobnicate the $2!\n', username, file.name, > > > to=sys.stderr) ... > For me, the problem with that proposal is not the precise format syntax, > but the fact that formatting is tied to a specific function which _also_ > outputs stuff to screen. So borrow a trick from Common Lisp and use a destination of None to mean "return the formatted text as a string". >>> x = printf("$2 $1", 123,321) 321 123 >>> print x None >>> x = printf("$2 $1", 123,321, to=None) >>> print x 321 123 Or is that too cryptic? -- g
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4