日々精進

新しく学んだことを書き留めていきます

2017-07-07から1日間の記事一覧

pythonでヒアドキュメントを書きたい

IT

qiita.com が参考になりました。 以下のように書くとインデントと前後の改行を無視してくれる。 もっとすんなり書ければいいけど。。 import textwrap string = textwrap.dedent(''' This is a {what}. I'm from {where}. ''').format(what="apple", where="…