[Tutor] Use python to parse the subject line of emails, listen for and react to commands

Danny Yoo dyoo at hashcollision.org
Fri Feb 27 20:56:25 CET 2015


On Thu, Feb 26, 2015 at 4:18 PM, Alan Gauld <alan.gauld at btinternet.com> wrote:
> On 26/02/15 20:51, Willie Sims wrote:
>> I know py can parse emails,  but I cant figure out how to limit to only
>> the subject and only if its in that certain format
>> and only if its coming from a recognized email address
>
> OK, Show us what you've tried. That makes it easier for us to see what is
> tripping you up. Otherwise we are just guessing.
>
> All 3 things you ask for can be done but we need a starting point and the
> best one is your existing, but faulty, code.


Also, if possible, include the sample inputs to the program, and the
desired output.  Pretend that your program worked perfectly, and show
input and imaginary-perfect output.

You can feel free to sanitize the input so that it's not revealing
anything personally sensitive, of course!  Just have something that
has enough of the shape of the original input that we can tell what
you want to extract.

This will allow folks to actually execute your program on the set of
data that you are using, and compare what you're getting vs what you
want.  To compare the difference, the delta, between what we've got
and what we want, is a good technique that folks can use to
troubleshoot.

Generally, it's be great if you can provide a short, self-contained,
correct example.  (http://sscce.org/)  We're not asking this to be
pedantic, but to sharpen the problem statement.  By making the
question self-contained and standalone, you'll make it much easier for
folks to *replicate* what you're seeing.  Without this, it becomes
harder for us to know what problem you're trying to solve, or what
difficulties you're encountering.


Good luck!


More information about the Tutor mailing list