AttributeError: Str -Objekt hat kein Attribut Decode
pip install h5py==2.10.0
Vision
pip install h5py==2.10.0
# You are trying to decode an object that is already decoded
# You have a str, there is no need to decode from UTF-8 anymore
# Simply drop the part
.decode('utf-8')
import imaplib
from email.parser import HeaderParser
conn = imaplib.IMAP4_SSL('imap.gmail.com')
conn.login('[email protected]', 'password')
conn.select()
conn.search(None, 'ALL')
data = conn.fetch('1', '(BODY[HEADER])')
header_data = data[1][0][1].decode('utf-8')
text= "ItsMyCode"
print(text.encode().decode())