x4nth055/pythoncode-tutorials

TypeError: list indices must be integers, not str

johann-lau opened this issue · 3 comments

Traceback (most recent call last):
  File "Inbox.py", line 39, in <module>
    subject, encoding = decode_header(msg['Subject'])[0]
TypeError: list indices must be integers, not str

I tried deleting [0] but it didn't work.

Hey @johann-lau ,

Not sure how's that happened, how you're running the script ?

Thanks,

I use terminal on MacOS. I have Python 3.9.1.

Worked fine now, thanks anyway! :)