エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
記事へのコメント1件
- 注目コメント
- 新着コメント
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
pythonでchomp的な事をやりたいときは「rstrip」 - Bye Bye Moore
Pythonのrstripメソッドは末尾の改行を消します。 RubyのString#chompですね。 for i in open('./exampl... Pythonのrstripメソッドは末尾の改行を消します。 RubyのString#chompですね。 for i in open('./example.yaml'): print(i.rstrip()) #foo: # bar: # - baz # - 3 一応、非破壊メソッドのようです >>> bar = "string\n\n" >>> bar 'string\n\n' >>> bar.rstrip() 'string' >>> bar 'string\n\n'
2019/03/13 リンク