Save the results of successful connection attempts to a CSV file.
(self)
| 201 | return success_flag[0], self.results # Return True and the list of successes if at least one attempt was successful |
| 202 | |
| 203 | def save_results(self): |
| 204 | """ |
| 205 | Save the results of successful connection attempts to a CSV file. |
| 206 | """ |
| 207 | df = pd.DataFrame(self.results, columns=['IP Address', 'User', 'Password', 'Port', 'Database']) |
| 208 | df.to_csv(self.sqlfile, index=False, mode='a', header=not os.path.exists(self.sqlfile)) |
| 209 | logger.info(f"Saved results to {self.sqlfile}") |
| 210 | self.results = [] |
| 211 | |
| 212 | def remove_duplicates(self): |
| 213 | """ |