コード例 #1
0
def a_ver_esa_lectura(pics):
    for line in fileinput.input():
        if not fileinput.isfirstline():  #a tomar viento la primera linea
            # print(line)
            separada = line[:len(line) - 1].split(' ')  # Separamos por ' '
            # print(separada)
            fila = fileinput.lineno()  # n de fila
            picLeido = Pic(fila - 1, separada)  # construyo el leido...
            pics.append(picLeido)  # y lo anado a la lista
コード例 #2
0
def estoTeSacaUnaListaDeSlides(slides):
    picsVerticales = []
    for line in fileinput.input():
        if not fileinput.isfirstline():  #a tomar viento la primera linea
            separada = line[:len(line) - 1].split(' ')  # Separamos por ' '
            fila = fileinput.lineno()  # n de fila
            picLeido = Pic(fila - 2, separada)  # construyo el leido...
            if (picLeido.orientation()):
                picsVerticales.append(picLeido)
            else:
                slides.append(Slide(picLeido))  # y lo anado a la lista
    unirVerticales(slides, picsVerticales)
コード例 #3
0
def estoTeSacaUnaListaDeSlides(slides):
    picsVerticales = []
    for line in fileinput.input():
        if not fileinput.isfirstline():  #a tomar viento la primera linea
            separada = line[:len(line) - 1].split(' ')  # Separamos por ' '
            fila = fileinput.lineno()  # n de fila
            picLeido = Pic(fila - 2, separada)  # construyo el leido...
            if (picLeido.orientation()
                ):  # es vertical, pa la lista de verticales
                picsVerticales.append(picLeido)
            else:  # no lo es, a los slides directo
                slides.append(Slide(picLeido))
    # unimos lo verticales a los slides, maximizando tags
    unirVerticales(slides, picsVerticales)
コード例 #4
0
ファイル: pico.py プロジェクト: blackKeyMoe/Pico
def create_pic(filenames):
    for filename in filenames:
        pic = Pic(filename)
        yield pic
コード例 #5
0
    # The hex filename is just the passed filename
    hfilename = filename
# If it's not HEX or ASM, what is it?
else:
    raise Exception("Unknown file extension")

# If a serial port has not been passed, use the first available one
if len(sys.argv) < 3:
    sport = glob.glob('/dev/ttyUSB*')[0]
    # Otherwise used the passed one
else:
    sport = sys.argv[2]

# Init new HexFile and PIC instances
hf = HexFile(hfilename)

prog = Pic(sport, 9600, 0x03FF)

# Write and verify the hex file to the pic
prog.write_file(hf)
prog.verify_file(hf)

# Write and verify the config word from the hex file to the pic
prog.write_verify_config_file(hf)

# Run the program on the pic
prog.execute()

# Close the connection with the pic
prog.close()