iPythonでのヒアドキュメントの問題
ipythonでmakoの入門(http://jkl.lomo.jp/archive/200809121156/)っぽいものを打ち込んでたんですが、pythonのシェルで打ち込むのと_ip.magicとか付くのねー。なんでだろー。
In [21]: text = """ ....: % for a in t_list : ....: % if a[0] == 't': ....: its two or three ....: % elif a[0] == 't': ....: four/five ....: % else : ....: one ....: % endif ....: % endfor ....: """ In [22]: print text -------> print(text) _ip.magic("for a in t_list :") _ip.magic("% if a[0] == 't':") its two or three _ip.magic("% elif a[0] == 't':") four/five _ip.magic("% else :") one _ip.magic("% endif") _ip.magic("endfor ")