直接用pip install pymssql 安裝 ,報錯:
Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
從google上查到別人的解決方案是 下載第三方的whl
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pymssql
之後 pip instal XXX.whl
OK了。
包: csv
核心代碼:
with open ("test.csv", "w", newline='') as f : #newline參數控制行之間是否空行
f_csv = csv.writer(f)
f_csv.writerow(headers) # headers爲表頭屬性名組成的數組
f_csv.writerows(csvlists) #csvlists爲多維數組,每個元素都是對應屬性的一行內容