当前位置: 首页>>代码示例>>Python>>正文


Python tempfile._RandomNameSequence方法代码示例

本文整理汇总了Python中tempfile._RandomNameSequence方法的典型用法代码示例。如果您正苦于以下问题:Python tempfile._RandomNameSequence方法的具体用法?Python tempfile._RandomNameSequence怎么用?Python tempfile._RandomNameSequence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tempfile的用法示例。


在下文中一共展示了tempfile._RandomNameSequence方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

# 需要导入模块: import tempfile [as 别名]
# 或者: from tempfile import _RandomNameSequence [as 别名]
def setUp(self):
        self.r = tempfile._RandomNameSequence() 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:4,代码来源:test_tempfile.py

示例2: test_get_six_char_str

# 需要导入模块: import tempfile [as 别名]
# 或者: from tempfile import _RandomNameSequence [as 别名]
def test_get_six_char_str(self):
        # _RandomNameSequence returns a six-character string
        s = self.r.next()
        self.nameCheck(s, '', '', '') 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:6,代码来源:test_tempfile.py

示例3: test_many

# 需要导入模块: import tempfile [as 别名]
# 或者: from tempfile import _RandomNameSequence [as 别名]
def test_many(self):
        # _RandomNameSequence returns no duplicate strings (stochastic)

        dict = {}
        r = self.r
        for i in xrange(TEST_FILES):
            s = r.next()
            self.nameCheck(s, '', '', '')
            self.assertNotIn(s, dict)
            dict[s] = 1 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:12,代码来源:test_tempfile.py

示例4: test_supports_iter

# 需要导入模块: import tempfile [as 别名]
# 或者: from tempfile import _RandomNameSequence [as 别名]
def test_supports_iter(self):
        # _RandomNameSequence supports the iterator protocol

        i = 0
        r = self.r
        try:
            for s in r:
                i += 1
                if i == 20:
                    break
        except:
            self.failOnException("iteration") 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:14,代码来源:test_tempfile.py

示例5: test_retval

# 需要导入模块: import tempfile [as 别名]
# 或者: from tempfile import _RandomNameSequence [as 别名]
def test_retval(self):
        # _get_candidate_names returns a _RandomNameSequence object
        obj = tempfile._get_candidate_names()
        self.assertIsInstance(obj, tempfile._RandomNameSequence) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:6,代码来源:test_tempfile.py

示例6: generate_temp_file_path

# 需要导入模块: import tempfile [as 别名]
# 或者: from tempfile import _RandomNameSequence [as 别名]
def generate_temp_file_path(extension: str) -> str:
    return TEMP_PATH_BASE + next(tempfile._RandomNameSequence()) + extension 
开发者ID:scherroman,项目名称:mugen,代码行数:4,代码来源:paths.py

示例7: setUp

# 需要导入模块: import tempfile [as 别名]
# 或者: from tempfile import _RandomNameSequence [as 别名]
def setUp(self):
        self.r = tempfile._RandomNameSequence()
        super().setUp() 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:5,代码来源:test_tempfile.py

示例8: test_get_six_char_str

# 需要导入模块: import tempfile [as 别名]
# 或者: from tempfile import _RandomNameSequence [as 别名]
def test_get_six_char_str(self):
        # _RandomNameSequence returns a six-character string
        s = next(self.r)
        self.nameCheck(s, '', '', '') 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:6,代码来源:test_tempfile.py

示例9: test_many

# 需要导入模块: import tempfile [as 别名]
# 或者: from tempfile import _RandomNameSequence [as 别名]
def test_many(self):
        # _RandomNameSequence returns no duplicate strings (stochastic)

        dict = {}
        r = self.r
        for i in range(TEST_FILES):
            s = next(r)
            self.nameCheck(s, '', '', '')
            self.assertNotIn(s, dict)
            dict[s] = 1 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:12,代码来源:test_tempfile.py

示例10: supports_iter

# 需要导入模块: import tempfile [as 别名]
# 或者: from tempfile import _RandomNameSequence [as 别名]
def supports_iter(self):
        # _RandomNameSequence supports the iterator protocol

        i = 0
        r = self.r
        for s in r:
            i += 1
            if i == 20:
                break 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:11,代码来源:test_tempfile.py


注:本文中的tempfile._RandomNameSequence方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。