Closed nettrino closed 6 years ago
Closing this as I resolved it using the configure_stream.py example. It would be useful if this was part of the README. It would be also an option that the default output is not stdout but that write_table()
returns a string/iterator, that users can redirect as they wish.
Hello,
I am trying to get the raw string output from a
MarkdownTableWriter
without printing to stdout. I have also tried redirecting output using thewith io.StringIO() as buf, redirect_stdout(buf):
pattern but that was unsuccessful. Trying to write to a file using the example of the Readme leads toAttributeError: 'MarkdownTableWriter' object has no attribute 'open'
. Any hints on how to resolve this? Essentially I just want a variable to hold all the contents ofwriter.write_table()