gilbert-yuan / odoo_config

odoo 尝试性小模块
26 stars 19 forks source link

python 小功能 列表全排列['', '', ''] #8

Open gilbert-yuan opened 5 years ago

gilbert-yuan commented 5 years ago
import itertools
target_list = ['开始日期:2019-07-01', '结束日期:2019-07-01', '产品:内部货号10590069', '目的库位:进货', '客户/供应商:XX电子(上海)有限公司', '拣货类型:收货']
result_list = []
for i in xrange(len(target_list)):
    for i in itertools.combinations(target_list, i + 1):
        for i_index, i_val in enumerate(i):
            print "%s). %s" % (i_index + 1, i_val)
        print ""