Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8775977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:56:21+00:00 2026-06-13T18:56:21+00:00

I have a small script: #!/usr/bin/python3.2 #takes the bad_emails out of full_emails and leaves

  • 0

I have a small script:

#!/usr/bin/python3.2
#takes the bad_emails out of full_emails and leaves us with good_emails

#This is a manually generated list of bad emails (bounce backs)
bad_list = []
with open("bad_emails.txt","r") as bad:
    for line in bad.readlines():
        bad_list.append(line)
#this is a list of ALL email addresses output by AcyMailing
full_emails = []
with open("full_emails.txt","r") as full:
    for email in full.readlines():
        if email in bad_list:
            pass
        else:
            full_emails.append(email)

#this is a final list containing only the email addresses with want
good_list = []
with open("good_emails","w") as good:
    for email in full_emails:
        good.write(email)

What I’m attempting to do is in short: take a list of email addresses from our mailer program called AcyMailing in Joomla and export it out. It has the following format:
“abc@abc.com”
“def@def.com”
“etc@etc.etc”

While my above script works (it gets rid of the ‘bad emails’ and leaves me with only the ‘good emails’ I’ve yet to find a way to make each email surrounded by quotation marks like AcyMailing (Joomla) uses. I’ve seen that a number of people use regex for such a task. Is that the only way to do this in python?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:56:23+00:00Added an answer on June 13, 2026 at 6:56 pm

    You should be able to just wrap the string in quotes:

    good.write('"' + email.strip() + '"\n')
    

    Or you can use .format:

    good.write('"{}"\n'.format(email.strip()))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a small python script like this: #!/usr/bin/env python from sqlite3 import
I have this small script that shows a caption for a img when it
This may be a basic question. I have written a small perl script to
Currently I have this small script that makes it possible to check if a
I have this small script: http://jsfiddle.net/gmAjC/ <input name=n1 value=test> <br/><span></span> <br/> <span style=background-color:red>after input</span>
I have a small script that sets multiple cookies, they all have this format
I have this small script I'm trying to get working on my webpage, its
I have small script that takes the value from a text input and needs
I have this small script that checks if a user name and email exist
I have a small script that looks like this: hideElements = arguments.shift().split ( ','

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.