生成字母和数组组成的随机字符串 :param int length: 字符串长度
(length=16)
| 281 | |
| 282 | |
| 283 | def random_str(length=16): |
| 284 | """生成字母和数组组成的随机字符串 |
| 285 | |
| 286 | :param int length: 字符串长度 |
| 287 | """ |
| 288 | candidates = string.ascii_letters + string.digits |
| 289 | return ''.join(random.SystemRandom().choice(candidates) for _ in range(length)) |
| 290 | |
| 291 | |
| 292 | def run_as_function(gen): |
no outgoing calls
no test coverage detected
searching dependent graphs…