Size: a a a

2020 November 02

PA

Pavel Aksenov in Python
Ivan Barchenkov
я верно понимаю, что также можно и img вставить?
с img сложнее, сейчас поищу
источник

IB

Ivan Barchenkov in Python
Pavel Aksenov
с img сложнее, сейчас поищу
Спасибо
источник

PA

Pavel Aksenov in Python
@ibarchenkov что-то типо такого должно быть
doc = DocxTemplate("my_word_template.docx")
       image = InlineImage(doc, '/home/user/photo_path.jpg', width=Mm(10))
       context = {'company_name': "World company",
                  "image": image}
       doc.render(context)
       doc.save("generated_doc.docx")

а в шаблоне {{ image }}
источник

PA

Pavel Aksenov in Python
источник

ЯА

Ярик Агресс... in Python
@bot.callback_query_handler(func=lambda c:True)
def inlin(c):
   if c.data == 'btn1':
       bot.edit_message_text(chat_id=c.message.chat.id, message_id=c.message.message_id, text="✉️Введите почту от аккаунта:")
       

А как мне сделать, чо бы оно слушало человека, и когда он отправит свообщение то оно продолжит
источник

IB

Ivan Barchenkov in Python
Pavel Aksenov
@ibarchenkov что-то типо такого должно быть
doc = DocxTemplate("my_word_template.docx")
       image = InlineImage(doc, '/home/user/photo_path.jpg', width=Mm(10))
       context = {'company_name': "World company",
                  "image": image}
       doc.render(context)
       doc.save("generated_doc.docx")

а в шаблоне {{ image }}
буду тестировать, спасибо
источник

DB

Dino Bambino in Python
Реьят можете закончить функцию?
def total_length(s1, s2):
""" (str, str) -> int
Return the difference of the lengths of s1 and s2.
>>> total_length('yes', 'no')
1
"""
источник

DB

Dino Bambino in Python
def total_length(s1, s2):
""" (str, str) -> int
Return the difference of the lengths of s1 and s2.
>>> total_length('yes', 'no')
1
"""
источник

PA

Pavel Aksenov in Python
return 1
источник

DB

Dino Bambino in Python
Для чего нужен return 1?
источник

PA

Pavel Aksenov in Python
чтобы значение совпадало с
источник

OO

Oleksiy Ovdiyenko in Python
kek с уровня программирования
источник

OO

Oleksiy Ovdiyenko in Python
Dino Bambino
Реьят можете закончить функцию?
def total_length(s1, s2):
""" (str, str) -> int
Return the difference of the lengths of s1 and s2.
>>> total_length('yes', 'no')
1
"""
return len(s1) - len(s2)
источник

P

P U N K in Python
Oleksiy Ovdiyenko
return len(s1) - len(s2)
+
источник

PA

Pavel Aksenov in Python
Oleksiy Ovdiyenko
return len(s1) - len(s2)
только еще в abs чтобы не было отрицательного числа
источник

P

P U N K in Python
Dino Bambino
def total_length(s1, s2):
""" (str, str) -> int
Return the difference of the lengths of s1 and s2.
>>> total_length('yes', 'no')
1
"""
def total_length(s1, s2):
    if s1 > s2:
         return len(s1) - len(s2)
    elif s1 < s2:
          return len(s2) -len(s1)
      else:
            return 0
источник

PA

Pavel Aksenov in Python
P U N K
def total_length(s1, s2):
    if s1 > s2:
         return len(s1) - len(s2)
    elif s1 < s2:
          return len(s2) -len(s1)
      else:
            return 0
Это как-то неправильно сравнивать строки
источник

P

P U N K in Python
Pavel Aksenov
Это как-то неправильно сравнивать строки
ну я на тел пишу! там кароч надо len() сравнивать думал поймет
источник

PA

Pavel Aksenov in Python
return abs(len(s1) - len(s2))
источник

B

Braindead in Python
Pavel Aksenov
Это как-то неправильно сравнивать строки
их можно сравнивать, питон позволяет
источник