以下の内容はhttps://anton0825.hatenablog.com/entry/2016/10/06/000000より取得しました。


io.BytesIOをstrに変換する

self.contentがio.BytesIOオブジェクトとすると以下のようなコードで変換出来る。

    def get_content_str(self) -> str:
        content_str: str = self.content.read().decode('UTF-8')
        self.content.seek(0)
        return content_str

readするたびにseek(0)しないといけないのは面倒だなぁ。。

参考:

stackoverflow.com




以上の内容はhttps://anton0825.hatenablog.com/entry/2016/10/06/000000より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14