Hi,
https://docs.python.org/3/library/email.parser.html
It says "For MIME messages, the root object will return True from its
is_multipart() method, and the subparts can be accessed via the
payload manipulation methods, such as get_body(), iter_parts(), and
walk()."
But when I try the following code, get_body() is not found. How to get
get_body() to work?
$ python3 -c 'import email, sys; msg =
email.message_from_string(sys.stdin.read()); print(msg.get_body())'
<<< some_text
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'Message' object has no attribute 'get_body'
--
Regards,
Peng
--
https://mail.python.org/mailman/listinfo/python-list
https://docs.python.org/3/library/email.parser.html
It says "For MIME messages, the root object will return True from its
is_multipart() method, and the subparts can be accessed via the
payload manipulation methods, such as get_body(), iter_parts(), and
walk()."
But when I try the following code, get_body() is not found. How to get
get_body() to work?
$ python3 -c 'import email, sys; msg =
email.message_from_string(sys.stdin.read()); print(msg.get_body())'
<<< some_text
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'Message' object has no attribute 'get_body'
--
Regards,
Peng
--
https://mail.python.org/mailman/listinfo/python-list