Ejemplo n.º 1
0
  else:
    out = '1'
    sound.play()
#gestion des cases a cocher    
def chk(id,value):
  global bits
  if value:
    bits[id] = 1
  else:
    bits[id] = 0
  process(inp.get_text())
#gestion de l'equation
def check(val):
  process(val)
#creation de l'interface
canvas.add_checkbox("chkA","A",chk,20)
canvas.add_checkbox("chkB","B",chk,20)
canvas.add_checkbox("chkC","C",chk,20)
inp = canvas.add_input("equ:",check,200)
inp.set_text("A & (not(B) | not(C))")
process(inp.get_text())

def color(value):
  if value == '1':
    return 'Yellow'
  else:
    return 'White'
#ceci est la fonction qui dessine l'ecran toutes les 17 millisecondes
def draw():
  
  global bits, out
Ejemplo n.º 2
0
#binaire_et
import canvas
canvas.clear_timers()
#canvas.clear()

bits = {'A': 0 }

def checkA(id,value):
  global bits
  if value:
    bits['A'] = 1
  else:
    bits['A'] = 0
    
canvas.add_checkbox("chkA","A",checkA,20)

def color(value):
  if value == '1':
    return 'Yellow'
  else:
    return 'White'

def draw(mycanvas):
  #ceci est la fonction qui gere l'ecran
  global bits
  left = 80
  top = 30
  canvas.draw_line((0,30+top),(500,30+top),4,'Blue')  
  cl2 = 'Yellow'
  
  canvas.draw_text("ENTREES",(left-30,25+top),24,cl2)