Well, I have a list of numbers inside of a file called "codes.txt", and I'm trying to sort them into an array like this:
{
codes: [
"430490",
"348327",
"923489"
]
}
Or just simply ["430490", "348327", "923489"]. How would I do this? I'm not trying to output this into a file, but create a variable that contains that JSON array. I have this so far:
codefile = open('codes.txt', 'r')
codelist = logfile.readlines()
codefile.close()
for line in codelist:
# ?
codes.txtlooks and how the data is present in it