小编mar*_*rty的帖子

How do I iterate through all possible values in a series of fixed lists?

(python)

so I have the following values & lists:

name = colour
size = ['256', '512', '1024', '2048', '4096', '8192', '16384', '32768']
depth = ['8', '16', '32']
scalar = ['False', 'True']
alpha = ['False', 'True']
colour = app.Color(0.5)
Run Code Online (Sandbox Code Playgroud)

and I want to iterate over these to produce every possible combination with the following structure:

createChannel(ChannelInfo(name, size, depth, scalar, alpha, colour))
Run Code Online (Sandbox Code Playgroud)

so the values for name, size, etc must stay in the same place, but they must iterate over all possible …

python

2
推荐指数
1
解决办法
1030
查看次数

标签 统计

python ×1