<br><br><div class="gmail_quote">On Fri, Jul 23, 2010 at 11:16 AM, INADA Naoki <span dir="ltr"><<a href="mailto:songofacandy@gmail.com">songofacandy@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Basic problem is Python doesn't provide a way to print values of expression<br>
into str like print prints to file.<br>
'foo{bar}baz'.format(bar=bar) is a bit bessy.<br>
’foo{bar}baz'.format(**vars()) or other technique is a bit trickey and messy.<br>
<br>
If<br>
  s = 'foo' bar 'baz'<br>
is too dirty, another Pythonic way I think of are:<br><br></blockquote><div>[snip]<br><br>What's wrong with<br>s = 'foo' + str(bar) + 'baz'<br><br>If you want something Pythonic:<br><br>import this<br>
...<br>Explicit is better than implicit<br><br>---<br>André<br><br> <br></div></div>