
エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
Pythonで__END__(もどき)を実現する - Qiita
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Pythonで__END__(もどき)を実現する - Qiita
import sys from io import StringIO def getdata(): ret = StringIO() with open(sys._getframe().f_ba... import sys from io import StringIO def getdata(): ret = StringIO() with open(sys._getframe().f_back.f_code.co_filename,'rb') as f: strStart = None while True: line = f.readline() if not line or line.rstrip().decode('utf-8') == '__END__': break strStart = line.rstrip() # read until the str finishes as ret should not contain trailing quote prev = None while True: line = f.readline() if not line or l