funcselenium.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:django-functest 作者: django-functest 项目源码 文件源码
def _make_temp_file_for_upload(self, upload):
        fname = os.path.join(tempfile.tempdir,
                             "{0}-{1}".format(random.randint(0, 1000000),
                                              upload.filename))
        with open(fname, "wb") as f:
            f.write(upload.content)

        def rmfile():
            os.unlink(fname)

        self.addCleanup(rmfile)
        return fname
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号