import sys import csv import json if __name__ == "__main__": for csv_file_path in sys.argv: with open(csv_file_path, mode='r', newline='', encoding='utf-8') as csv_file: csv_reader = csv.DictReader(csv_file) for row in csv_reader: print(json.dumps(row, ensure_ascii=False))