B
B
blizzard2019-12-16 21:59:36
Python
blizzard, 2019-12-16 21:59:36

HOW to make a selection of letters from a mailbox for a certain date?

Here is a query where the dates are explicitly specified, it works fine:

result, data = mail.search(None, '(SINCE "01-NOV-2019" BEFORE "20-DEC-2019")')

Here is such a query, where there is a reference to variables, no longer works:
result, data = mail.search(None, '(SINCE {since} BEFORE {till})'.format(since=since, till=till))

Variables since and till:
since = self.Since.text().replace('.', '-')
        till = self.Till.text().replace('.', '-')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2019-12-16
@dimonchik2013

debug with prints (c)
correctly
, in general, you need to understand that in search (as in sql) you must pass a formatted query, i.e. with all quotes, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question