Debian – Convert text file that contains colon to json
Existing Code import json filename = 'thunar-volman/debian/control' dict1 = {} with open(filename) as fh: for line in fh: print(line) command, description = line.strip().split(': ') print(command) print(description) dict1[command.strip()] = description.strip() with open("test.json", "w") as out_file: json.dump(dict1, out_file, indent=4, sort_keys = False)…