cur.execute("""
INSERT INTO some_table (id, created_at, last_name)
VALUES (%s, %s, %s);
""",
(10, datetime.date(2020, 11, 18), "O'Reilly"))
import numpy
import cv2
import sys
import pathlib
target_path = pathlib.Path(sys.argv[0]).parent \ 'image.png'
img = numpy.zeros((480, 640, 3), numpy.uint8)
cv2.circle(img, (320, 240), 100, (128, 255, 255), -1)
retval, img_data = cv2.imencode(target_path.suffix, img)
if retval:
with target_path.open('wb') as imfile:
imfile.write(img_data)
print('Image saved.')
else:
print('Failed to encode the image!')
Тогда вначале, до цикла, будет
current = 0
При задании элемента явно будет
current = letterlist.index(x)
Ну а переход дальше будет тривиален,
current += 1
Чтобы прочитать текущий элемент, можно будет обратиться
letterlist[current]