leadleds.py

Created by schraf

Created on October 24, 2022

1.33 KB

Vidéo d’explication ici

Partie GIMP

Création des 50 caractères

def alpha():
    img = gimp.image_list()[0]
    cal_txt = img.layers[0]
    alpha = "".join([chr(32+i) for i in range(59)])
    pdb.gimp_text_layer_set_text(cal_txt, alpha)
    pdb.gimp_text_layer_resize(cal_txt, 295, 12)

Conversion de votre police en code

def nw():
    img = gimp.image_list()[0]
    drw = pdb.gimp_image_active_drawable(img)
    code = ""
    for c in range(295):
      nb = 0
      for l in range(8):
       v = list(pdb.gimp_image_pick_color(img,drw,c,l,1,0,0))[:-1]
       if sum(v) == 0:
        nb = nb + 2**l
      code += ("0"+(hex(nb)[2:]))[-2:]
    return code

Exemples de codes

Futurist Fixed

'000000000000005e0000000404000000787c3400006cbc74000c2c386460205c7c600000000c00000000fc00000000fc0000000c0c000000007800000000c000000000200000004000000000601c0000007c443c0000007c00000044641c000044547c0000387c2000004c4c7000007854700000641c0400007c547c00000c741c00000000000000d00000000020505000003030300000505020000014740c003c7c6c7c1c60182c3040007c547c003844444400007c444438007c544000007c1414003844445434000010107c00007c000000407c0000007c284400007c4040007c3860107c7c0810207c3c4444443c007c140c00384444647c007c344c00004c54740000047c04003c4040403c0438601c0c70381c6038046c186400000c700c0000645c4400'

Monaco 8 amélioré

'000000000000005e00000006000600287e287e28004eff72004230084600764a5670000000060000007c8282000082827c0000281c280000207020000000c000000010101000000040000040300806003c42427e0000427e400000724a4600004a4a7600102c227e00004e4a72003c524a7a0000621a060000764a76000c52527e0000004800000000c8000000103844441010101010444438100000520a06003e5a5e621c4038263840007e52522c1866424200007e427e00007e524200007e1202001866427200007e107e0000427e42000040423e00007e1c6200007e4040007e1c300c7e7e04187e003c42427e00007e120e003c42627e80007e126e00004e4a700002027e0202007e407e000638601e001e7018701e0066186600020478060060524a46


from kandinsky import *
from time import *

code =  '000000000000005c0000000c000c00287c287c28002c7e34000460380c40707c542c4000000c00000000384400004438000000281c280000103810000000c00000001010100000400000000040380400007c443c0000007c00000074545c000044547c0000387c2000005c54740000785470000004047c00007c547c00005c547c00000000000000d00000000020505000003030300000505020000004541c00386c647c1860182c3040007c547c003844444400007c444438007c544000007c1414003844445434007c10107c00007c000000407c0000007c284400007c4040007c3860107c7c0810207c3c4444443c007c140c00384444245c007c344c00004c54740000047c04003c4040403c04386038043c6010603c446c186c44000c700c000064544c00'

def car(p, x, t):
  marge = 110 - 3*t
  for i in range(5):
    v = int("0x"+code[p + 2*i:p + 2*i + 2])
    for j in range(8):
      coul = (0,255,255) if v>>j & 1 != 0 else (60,60,60)
      if x + t*i >= -t:
        fill_rect(x + t*i, marge + t*j, t - 1 ,t - 1, coul)
        

def led(txt, t = 15):
  fill_rect(0,0,320,222,(0,0,0))
  n = 1
  txt = txt.upper() + " "*int(320/(6*t))
  taille = len(txt) + 1
  while True:
    x = 320 - 6*t*n
    aff = txt[:n]
    for i in range(n):
      pos = ord(aff[i]) - 32
      if 0 <= pos < 59:
       car(10*pos, x + 6*t*i, t)
      else:
       car(0, x + 6*t*i, t)       
    n = (n + 1) % taille
    sleep(0.2)

led("Les carottes sont cuites ! je repete...",4)

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our <a href="https://www.numworks.com/legal/cookies-policy/">cookies policy</a>.