Remove last comma before "]" in a json file using python
I'm trying to create a json file in below format. However, I'm unable to remove the last comma just before "]" fl = open('fri.txt', 'r') fw = open('test.txt', 'w') lines=fl.readlines() lines = [x.strip() for x in lines] #print(lines) #print(type(lines)) month…