如何将 Tally ERP-9 与 Python(Django) 集成以实现基于账本的推送和拉取金额。
问问题
2953 次
1 回答
2
import pyodbc
conn = pyodbc.connect('DSN=TallyODBC64_9123;SERVER=({local});DRIVER=Tally ODBC DRIVER64;PORT=9123')
cursor=conn.cursor()
data=cursor.execute("SELECT $Name,$_PrimaryGroup,$_ClosingBalance,$OpeningBalance FROM Ledger")
columns = [column[0] for column in data.description]
actual_cols=[s.strip('$') for s in columns]
rows = data.fetchall()
from dfply import *
import pandas as pd
df = pd.DataFrame.from_records(rows)
df.columns=actual_cols
于 2019-11-23T07:37:51.017 回答