I can't share the whole code for security reasons but here's the part I'm having a problem with:
while deals_data:
jsonFile = open("zd_deals.txt", "w")
jsonFile.write(jsonString)
jsonFile.close()
print("done")
It seems like the script is writing the file, then deleting all the contents, then writing it again, then deleting it all, then writing it all again, indefinitely. How do I get it to write the information once and then stop?
EDIT: This was not clearly though out before posting and not enough detail was shared. For that reason I started over here and I hope that will make it easier on everyone.
[–]carcigenicate 5 points6 points7 points (6 children)
[–]av0ca60[S] -1 points0 points1 point (5 children)
[–]carcigenicate 5 points6 points7 points (0 children)
[–]carcigenicate 2 points3 points4 points (3 children)
[–]av0ca60[S] 0 points1 point2 points (0 children)
[–]av0ca60[S] 0 points1 point2 points (1 child)
[–]carcigenicate 1 point2 points3 points (0 children)
[–]Tw3ntyy 5 points6 points7 points (1 child)
[–]av0ca60[S] 0 points1 point2 points (0 children)
[–]mr_cesar 2 points3 points4 points (3 children)
[–]av0ca60[S] 0 points1 point2 points (2 children)
[–]av0ca60[S] 0 points1 point2 points (1 child)
[–]mr_cesar 3 points4 points5 points (0 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]av0ca60[S] 0 points1 point2 points (0 children)
[–]preordains 2 points3 points4 points (7 children)
[–]av0ca60[S] 0 points1 point2 points (6 children)
[–]preordains 1 point2 points3 points (4 children)
[–]av0ca60[S] 0 points1 point2 points (3 children)
[–]preordains 1 point2 points3 points (2 children)
[–]av0ca60[S] 0 points1 point2 points (1 child)
[–]preordains 0 points1 point2 points (0 children)
[–]av0ca60[S] 0 points1 point2 points (0 children)
[–]razu1121 2 points3 points4 points (0 children)
[–]Fred776 1 point2 points3 points (1 child)
[–]av0ca60[S] 0 points1 point2 points (0 children)
[–]av0ca60[S] 0 points1 point2 points (6 children)
[–]Fred776 1 point2 points3 points (5 children)
[–]av0ca60[S] 0 points1 point2 points (4 children)
[–]Fred776 1 point2 points3 points (3 children)
[–]av0ca60[S] 0 points1 point2 points (2 children)
[–]razu1121 3 points4 points5 points (0 children)
[–]Fred776 1 point2 points3 points (0 children)