Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.python > #4321
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Christopher Arndt <chris@chrisarndt.de> |
| Newsgroups | de.comp.lang.python |
| Subject | Re: [Python-de] Datum aus Mails parsen |
| Date | Tue, 22 Mar 2016 23:44:18 +0100 |
| Lines | 70 |
| Message-ID | <mailman.24.1458687052.2244.python-de@python.org> (permalink) |
| References | <2799516.e1sbLbDSJX@horus> |
| Mime-Version | 1.0 |
| Content-Type | multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DbR3NgqLgtVffBVLOvkubxRLloGgAeHIr" |
| X-Trace | news.uni-berlin.de l5tp9c9u7W+sSfjxxri0KAV0Xy3qKLz/xd21e7voUURA== |
| Return-Path | <chris@chrisarndt.de> |
| X-Original-To | python-de@python.org |
| Delivered-To | python-de@mail.python.org |
| X-Virus-Scanned | Debian amavisd-new at mx1.0x20.eu |
| Openpgp | id=F0BA1EAE86651989C0A1C9901E0D97B33A4E1F31 |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 |
| In-Reply-To | <2799516.e1sbLbDSJX@horus> |
| X-BeenThere | python-de@python.org |
| X-Mailman-Version | 2.1.21 |
| Precedence | list |
| List-Id | Die Deutsche Python Mailingliste <python-de.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-de>, <mailto:python-de-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-de/> |
| List-Post | <mailto:python-de@python.org> |
| List-Help | <mailto:python-de-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-de>, <mailto:python-de-request@python.org?subject=subscribe> |
| Xref | csiph.com de.comp.lang.python:4321 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
Am 22.03.2016 um 20:59 schrieb Florian Lindner:
> ich will das Datum einer Mail rausfinden, ob es das Sende- oder Empfangsdatum
> ist, oder eins der Stationen in der Mitte ist egal.
>
> Nun frage ich mich, was da am zuverlässigsten ist?
Du musst wissen, ob dir das Datum nah an der Quelle oder am Empänger
wichtiger ist.
Such dir eins aus:
import email
from dateutil.parser import parse # [1]
with open('mail.eml') as fp:
mail = email.message_from_file(fp)
dates = [parse(recv.split(';')[1])
for recv in mail.get_all('Received')]
Chris
[1] https://pypi.python.org/pypi/python-dateutil/
Back to de.comp.lang.python | Previous | Next | Find similar
Re: [Python-de] Datum aus Mails parsen Christopher Arndt <chris@chrisarndt.de> - 2016-03-22 23:44 +0100
csiph-web