SyntaxError: invalid syntax (help)

Discussion in 'Python' started by Linh Lee, Aug 28, 2022.

  1. Linh Lee

    Linh Lee New Member

    Joined:
    Aug 18, 2022
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Female
    Location:
    San Francisco
    Trying to search/delete for specific user with one letter name, "a", and always changing domains.
    Some addresses from this spam:
    Code:
    a@kragar.imentss.com
    a@octobertres.com
    a@cngruel.com
    

    Need help please, fixing invalid syntax error.

    CODE:
    Code:
    from imap_tools import MailBox, A
    with MailBox('imap.mail.yahoo.com').login('name@yahoo.com', 'PWD', 'Bulk') as mailbox:
        DELETE messages that contains 'a@*.*' in body from Bulk folder
        mailbox.delete(mailbox.fetch(A(body='a@*.*')))

    ERROR:
    Code:
    λ python DeleteEmailFiles.py
      File "C:\Users\Desktop\Desktop\Python Spam Buster\DeleteEmailFiles.py", line 5
        DELETE messages that contains 'a@*.*' in body from Bulk folder
               ^^^^^^^^
    SyntaxError: invalid syntax
     
    Last edited: Aug 28, 2022
  2. Linh Lee

    Linh Lee New Member

    Joined:
    Aug 18, 2022
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Female
    Location:
    San Francisco
    My bad, line needed to be commented out!
    New error:
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice