0
0

More than 1 year has passed since last update.

はじめに

移植やってます。
( from python 3.7 to ruby 2.7 )

tempfile (Python)

import tempfile

    def test_tmpfile_text(self):
        with tempfile.TemporaryFile(mode='r') as f:
            self._check_file_object(f, False)

おおぅ

どうすRuby

require 'tempfile'

  def test_tmpfile_text
    Tempfile.open("temp"){ |f|
      _check_file_object(f, false)
    }
  end

気になるのは、tempの場所とライフサイクルでしょうか。

メモ

  • Python の tempfile を学習した
  • 百里を行く者は九十里を半ばとす
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0