![]() ![]() Note that the u prefix that was worrying you doesn't appear in the result. jsontocsv - Module for converting json data to csv data, and various supplementry methods. Output: time,SOURCE,PLACE,TEMP,LIGHT,HUMIDITY Python: package jsontocsv jsontocsv(version 1.0.0) index Copyright (c) 2017 Timothy Savannah All Rights Reserved Licensed under terms of LGPLv3. Write the header to get the title, then use writerows on the list of dictionaries to write the data. Title = "time,SOURCE,PLACE,TEMP,LIGHT,HUMIDITY".split(",") # quick hackĬw = csv.DictWriter(f,title,delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)įixing title order is done by reusing the order you provided (else order is the dictionary order, not the one you want). With open("output.csv","w",newline="") as f: # python 2: open("output.csv","wb") I have a list of JSON that I print it like this: for item in points: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |