随笔 - 633,  文章 - 0,  评论 - 13,  阅读 - 48万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

1.安装

Python国内镜像地址
名地址 global.index-url install.trusted-host
阿里云 https://mirrors.aliyun.com/pypi/simple/ mirrors.aliyun.com
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/ pypi.tuna.tsinghua.edu.cn
华为云 https://repo.huaweicloud.com/repository/pypi/simple repo.huaweicloud.com
豆瓣 https://pypi.douban.com/simple/ pypi.douban.com
中科大学 http://pypi.mirrors.ustc.edu.cn/simple/ pypi.mirrors.ustc.edu.cn

pip install allpairspy  https://pypi.tuna.tsinghua.edu.cn/simple/

pip install allpairspy

2.使用程序

复制代码
from allpairspy import AllPairs
from collections import OrderedDict
import itertools

print("无序用列表:")
a=["搜素开始时间","搜素结束时间"]
b=["大于","等于","小于"]
c=["产品发行开始时间","产品发行结束时间"]

test_parameters = [a,b,c]

print(test_parameters)



print("无条件过滤组合用例")
for i,pairs in enumerate(AllPairs(test_parameters)):
    print("{:2d}:{}".format(i+1,pairs))

print("排列组合:")
res=itertools.product(a,b,c,repeat=1)
result =list(res)
for i in range(0,len(result)):
    print("{:2d}:{}".format(i + 1, "".join(result[i])))
    # print("{:2d}:{}".format(i + 1, result[i]))




print("有序用字典:")

d_test_param = OrderedDict({
    "搜素时间":a,
    "判断":b,
    "发行时间":c
})
print(d_test_param)

for i,pairs in enumerate(AllPairs(d_test_param)):
    print("{:2d}:{}".format(i+1,pairs))
复制代码

 

posted on   大话人生  阅读(30)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
点击右上角即可分享
微信分享提示