current = 0
current = letterlist.index(x)
current += 1
letterlist[current]
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!')
2. Написать
Если у тебя есть сложности, приведи свой код, путь даже нерабочий, и описание симптомов ошибки (текст ошибки, или как поведение программы отличается от желаемого).
Если ждёшь, что учебное задание напишут за тебя... ну тут одно из двух.