Write to both console and file
(self, text)
| 39 | print(f"📄 Output saved to: {self.filename}") |
| 40 | |
| 41 | def write(self, text): |
| 42 | """Write to both console and file""" |
| 43 | self.original_stdout.write(text) |
| 44 | if self.file: |
| 45 | self.file.write(text) |
| 46 | self.file.flush() # Ensure immediate write |
| 47 | |
| 48 | def flush(self): |
| 49 | """Flush both outputs""" |