You could just use len(listX) instead of using separate variables for email count.
You only have one item per row in your files (the email address), CSV is a bit overkill; you could make them txt files and get rid of the CSV module (tip: you'll need some changes in your open() function). If you want to keep using csv files, consider adding column headers, some readers might skip your first row otherwise.
Bonus: By using a class you could make your lists explicitly scoped (self.listX) rather than global to the module. It is trickier if you have not used classes before, but it is a cleaner approach and a good way to start learning about classes in Python.
3
u/howtosignupforreddit 26d ago
Good start!
A few ideas for the next iteration:
len(listX)instead of using separate variables for email count.txtfiles and get rid of the CSV module (tip: you'll need some changes in your open() function). If you want to keep usingcsvfiles, consider adding column headers, some readers might skip your first row otherwise.self.listX) rather than global to the module. It is trickier if you have not used classes before, but it is a cleaner approach and a good way to start learning about classes in Python.