Closed zxczrx123 closed 1 year ago
import io
import csv
reader = csv.reader(io.StringIO(x.get_csv_string()))
with open('string2csv.csv', 'w') as out_file:
writer = csv.writer(out_file)
writer.writerows(reader)
I have found a way. Is there a more concise io interface?
That looks pretty good to me.
No, PrettyTable only does string output via the get*_string
methods.
x.get_csv_string() no longer works... I've been using this method for 6 months or so without any issue, went to rerun my code today and i keep getting an attribute error... any suggestions?
@ewyluda Please open a new, detailed issue: https://github.com/jazzband/prettytable/issues/new/choose
Hi, thanks for your great work!
I want to know how to save prettytable as csv or json file elegantly?