あなたが求めているのは、いくつかのイテラブルのcartesian productです:
import itertools
import pprint
aa = [[230, 115, 90, 264], [12, 9, 5], [-1], ['on', 'off']]
ab = [[230, 115, 90, 264], ['on', 'off']]
for iterable in [aa, ab]:
pprint.pprint(list(itertools.product(*aa)))
結果:
[(230, 12, -1, 'on'),
(230, 12, -1, 'off'),
(230, 9, -1, 'on'),
(230, 9, -1, 'off'),
(230, 5, -1, 'on'),
(230, 5, -1, 'off'),
(115, 12, -1, 'on'),
(115, 12, -1, 'off'),
(115, 9, -1, 'on'),
(115, 9, -1, 'off'),
(115, 5, -1, 'on'),
(115, 5, -1, 'off'),
(90, 12, -1, 'on'),
(90, 12, -1, 'off'),
(90, 9, -1, 'on'),
(90, 9, -1, 'off'),
(90, 5, -1, 'on'),
(90, 5, -1, 'off'),
(264, 12, -1, 'on'),
(264, 12, -1, 'off'),
(264, 9, -1, 'on'),
(264, 9, -1, 'off'),
(264, 5, -1, 'on'),
(264, 5, -1, 'off')]
[(230, 12, -1, 'on'),
(230, 12, -1, 'off'),
(230, 9, -1, 'on'),
(230, 9, -1, 'off'),
(230, 5, -1, 'on'),
(230, 5, -1, 'off'),
(115, 12, -1, 'on'),
(115, 12, -1, 'off'),
(115, 9, -1, 'on'),
(115, 9, -1, 'off'),
(115, 5, -1, 'on'),
(115, 5, -1, 'off'),
(90, 12, -1, 'on'),
(90, 12, -1, 'off'),
(90, 9, -1, 'on'),
(90, 9, -1, 'off'),
(90, 5, -1, 'on'),
(90, 5, -1, 'off'),
(264, 12, -1, 'on'),
(264, 12, -1, 'off'),
(264, 9, -1, 'on'),
(264, 9, -1, 'off'),
(264, 5, -1, 'on'),
(264, 5, -1, 'off')]
あなたはitertools' 'で見ましたか難しいですか? 'list(itertools.product(* ab))'? –
@Chris_重複したターゲットを覚えていますか? –
@ Jean-FrançoisFabreまだ見ていない –