본문 바로가기 메뉴 바로가기

My Life DB

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

My Life DB

검색하기 폼
  • 분류 전체보기 (44)
  • 방명록

python (1)
파이썬으로 SQLite db파일을 csv로 export

import sqlite3, os conn = sqlite3.connect('example.db')c = conn.cursor() com_te="" for row in c.execute('SELECT * FROM de_addr order by id desc'): for m in range(1,9):com_te = com_te + str(row[m])+","com_te=com_te+"\n" f=open("addr.csv","w")f.write(com_te)f.close c.close() print("CSV file export done.")

카테고리 없음 2016. 11. 23. 19:18
이전 1 다음
이전 다음
최근에 올라온 글
«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
글 보관함
TAG
  • 웹사이트
  • 청귤
  • 미 대선
  • SQLite
  • 쇼핑
  • 소프트웨어
  • python
  • r
  • 건강
more
Total
Today
Yesterday

Blog is powered by Tistory / Designed by Tistory

티스토리툴바