One of the ways is to use csv module. I just added the following lines of code at the bottom of the script above, and the query results were saved as csv file on my desktop.
import csv
import os
fields = ['delegator', 'delegatee', 'vesting_shares', 'timestamp']
filepath = os.getcwd() + '/Desktop/' + 'delegation.csv'
with open(filepath, 'w') as f:
write = csv.writer(f)
write.writerow(fields)
write.writerows(result)
One of the ways is to use csv module. I just added the following lines of code at the bottom of the script above, and the query results were saved as csv file on my desktop.
import csv import os fields = ['delegator', 'delegatee', 'vesting_shares', 'timestamp'] filepath = os.getcwd() + '/Desktop/' + 'delegation.csv' with open(filepath, 'w') as f: write = csv.writer(f) write.writerow(fields) write.writerows(result)
Great one!
Thanks a lot!