Часть электронного письма, которая интересует мой код:
Код: Выделить всё
"BOT ID: 4824CF8B-2986-11EC-80F0-84A93851B964"Код: Выделить всё
if content_type == "text/plain" and "attachment" not in content_disposition:
import re
ID_pattern = r"BOT ID: (\w+)-(\w+)-(\w+)-(\w+)-(\w+)"
machine_id = re.findall(ID_pattern, body)
print(machine_id)
Код: Выделить всё
"[('4824CF8B', '2986', '11EC', '80F0', '84A93851B964')]"xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxx
Спасибо всем, ребята.
Код: Выделить всё
import re
ID_pattern = r"BOT ID: (\w+)-(\w+)-(\w+)-(\w+)-(\w+)"
machine_id = re.findall(ID_pattern, body)
print(machine_id)
Код: Выделить всё
[('4824CF8B', '2986', '11EC', '80F0', '84A93851B964')]Код: Выделить всё
4824CF8B-2986-11EC-80F0-84A93851B964Подробнее здесь: https://stackoverflow.com/questions/792 ... email-body
Мобильная версия