code: def export(g, csv_fname):
      
      with open(csv_fname, "w") as f:
          num_tuples = 0
          f.write('"num","subject","predicate","object"\n')
          for subj, pred, obj in g:
              num_tuples += 1
              f.write('"' + str(num_tuples) + '",')
              f.write('"' + get_string_from_rdf(subj) + '",')
              f.write('"' + get_string_from_rdf(pred) + '",')
              f.write('"' + get_string_from_rdf(obj) + '"\n')
      print("Finished exporting " , num_tuples, " tuples")
docs: export a graph to CSV for simpler viewing