import pyodbc
cnxn=pyodbc.connect('DSN=TallyODBC64_9000;SERVER=({AAACC_SERVER:1001});DRIVER=Tally ODBC DRIVER64;PORT=9000')
cursor=cnxn.cursor()
cursor.execute("select $Name, $parent, $_primaryGroup, $openingBalance, $DebitTotals, $CreditTotals, $_closingBalance from LEDGER")
row=cursor.fetchone()
with open("hotel.csv","w") as f:
while row:
print(row, file=f)
row=cursor.fetchone()
I wand to put Fromdate and toDate on the above program