"".join()
происходит её итеративное создание.str.join(iterable) Return a string which is the concatenation of the strings in iterable. A TypeError will be raised if there are any non-string values in iterable, including bytes objects. The separator between elements is the string providing this method.
for frame in objects_frame_position:
video.set(cv2.CAP_PROP_POS_FRAMES, frame)
ret, video_frame = video.read()
if ret:
object_frame_info = objects_frame_position[frame]
position: Position = object_frame_info['Position']
object_border = video_frame[position.y:position.y +
position.height, position.x:position.x+position.width]
_, buffer = cv2.imencode('.jpg', object_border)
io_buffer = io.BytesIO(buffer)
objects_images[object_id].append(io_buffer)
df = df.style.applymap(print_errors)
df.to_excel("result.xlsx")
df.style.applymap(print_errors).to_excel("result.xlsx")
import subprocess as sub
import threading as th
import time
def startrar():
with open("test.log", "wb+") as file:
rar = sub.run('"C:\\Program Files\\WinRAR\\Rar.exe" a -r -ep1 -v1g "D:\\mysqlrar" "D:\\Аудиокниги\\book"',
shell=True, stdout=file, stderr=sub.PIPE)
def printpipe():
while True:
with open("test.log", "rb") as file:
print(file.read().decode('cp1251'))
time.sleep(1)
threads = []
threads.append(th.Thread(target=startrar))
threads.append(th.Thread(target=printpipe))
for i in threads:
i.start()
sheduler.add_job(thread_maintaining_communication,"interval", seconds=20)
bot.add_custom_filter(asyncio_filters.StateFilter(bot))
sheduler.start()
loop = asyncio.get_event_loop()
loop.run_until_complete(bot.polling(skip_pending=True))
def NewValideLogin(DataBase):
DataBase[input("Введите новый валидный логин: ")] = input("Введите пароль, для нового логина: ")
return DataBase
def RemoveLogin(DataBase):
del DataBase[input("Введите логин, который нужно удалить: ")]
return DataBase
DataBase = {'Admin':'AdminKrasavhicIMolodec228', 'User':'12340987'}
UserMessage1 = "Admin"
UserMessage2 = "AdminKrasavhicIMolodec228"
if UserMessage1 in DataBase:
print('Логин засчитало')
if UserMessage2 == DataBase[UserMessage1]:
print('Пароль засчитало')
else:
print('Пароль не засчитало')
else:
print("Логин не засчитало")
DataBase = NewValideLogin(DataBase)