Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def to_csv(self, filename=None):
""" Exports the generated table into a CSV file.
Returns a CSV string if filename is None.
:param filename: CSV file path
:type filename: str
"""
return export_to_csv(self.headers, self.data, filename)