apt install screen
from functools import reduce
a = bytes([x for x in range(3)]) # байтовая строка для примера
row = reduce(lambda x,y: x + list(map(int, list('{:08b}'.format(y)))), a, [])
print('исходный массив байт: ', a)
print('массив бит: ', row)
# исходный массив байт: b'\x00\x01\x02'
# массив бит: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0]
var1 = 0
def func(var):
return var+1
var1 = func(var1)
apt-get install python3-pyqt5.qtwebengine
apt-get install python3-pyqt5.qtwebkit
export QT_QPA_PLATFORM=offscreen
import os
from PIL import Image
directory = r'C:\Users\user\Desktop\*каталог, в котором находятся изображения*'
images = os.listdir(directory)
for image_name in images:
image_path = os.path.join(directory, image_name)
img = Image.open(image_path)
img_size = (200, 200)
img.thumbnail(img_size)
new_image_name = '_s.'.join(image_name.rsplit('.', 1))
new_image_path = os.path.join(directory, new_image_name)
img.save(new_image_path)
def checking(s): return [any([not(len([x for x in b[i:i+3] if x])-3) for i in range(len(b)-2)]) for b in [list(map(str.isalpha, s.split()))]][0]
print(checking('Test Test Test')) #True
print(checking('Test Test Test 123 123')) #True
print(checking('Test 125s Test 123 123')) #False
str.slice(1, -1).split(', ')
// или
JSON.parse(str.replace(/[а-яё]+/g, '"$&"'))
// или
str.match(/[^\s\[\],]+/g) ?? []