Skip to content

Instantly share code, notes, and snippets.

View MiquelIR's full-sized avatar

Miquel Isern Roca MiquelIR

  • Channable
  • Utrecht
View GitHub Profile
@MiquelIR
MiquelIR / control_bits.py
Created December 12, 2018 14:11
Seleccionar bits de control para configurar excepción de contadores TG
from itertools import product, combinations
array = dict.fromkeys([0,1,2,3,4,5,6,7], 0)
stuff = [1,3,7]
for L in range(0, len(stuff)+1):
for subset in combinations(stuff, L):
subarray = array.copy()
value = ''
for x in subset:
subarray[x] = 1
for y in sorted(subarray.keys(), reverse=True):