I have an access database. Inside are a few tables I created. I want to use python to read through one of the tables and make a list of everything in a column. I want to com
You can convert the table to csv so you can open it with excel
Try this:
import csv
roomnumber = 0.00
roomname = 0.00
lueftungList = []
import time
class Lueftung:
def getData(self):
global roomnumber
global roomname
roomnumber = input("roomnumber: ")
roomname = input("roomname : ")
myFormattedList = [ '%.2f' % elem for elem in lueftungList ]
def main(self):
global roomnumber
global roomname
lueftungList.append(["", roomnumber, roomname, "", ""])
lueftungList.insert(0,[(time.strftime("%d.%m.%Y")), "roomnumber", "roomname",])
# convert to csv
with open("lueftung.csv", "w", newline="") as csvfile:
cwriter = csv.writer(csvfile, delimiter=";")
for row in lueftungList:
cwriter.writerow(row)
if __name__ == "__main__":
luft = Lueftung()
luft.main()