Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Notepad
- 노트패드뿔뿔
- OpenSCAD
- React #React-Table
- linux ssh root debian
- FTP
- SFTP
- mailutils
- 보안연결실패
- Notepadplus
- Notepad++
- react #router
- PDFCreator
- startfile
- debian
- cifsutils
- PyLucene
- springboot #spring #jackson
- VM 호스트 주소
- Windows
- Printer Driver
- 윈도우
- Regex
- 임펠러
- Basic Auth
- 소스 <script> 로딩 실패
- firefox 파이어폭스
- 정규표현식
- 가상머신호스트
Archives
- Today
- Total
JJC's 테크니컬 다이어리
Python SQLite 코드 샘플-외부 파일 읽어 처리 본문
#!/opt/bin/python
# -*- coding: cp949 -*-
import sys
sys.path.append('/opt/lib/python2.4/site-packages')
from pysqlite2 import dbapi2 as sqlite
import csv, os, string
print "Content-Type: text/html"
print
print "Insert Start.."
print "<br>"
outfile = './' +'insertsql.sql'
# updateline="update credituse set price=price*(-1) where price>0 and accept='취소'"
# Create a connection to the database file "mydb":
con = sqlite.connect("mydb")
cur = con.cursor()
f = open(outfile,'r')
for line in f:
print line
print "<br>"
cur.execute(line)
f.close()
#cur.execute(updateline)
con.commit()
print "<center>"
print "<br>"
print "데이타베이스에 자료가 입력되었습니다!!"
print "<br>"
print "<br>"
print "<a href=index.html>초기화면으로 </a>"
print "</center>"
# -*- coding: cp949 -*-
import sys
sys.path.append('/opt/lib/python2.4/site-packages')
from pysqlite2 import dbapi2 as sqlite
import csv, os, string
print "Content-Type: text/html"
print "Insert Start.."
print "<br>"
outfile = './' +'insertsql.sql'
# updateline="update credituse set price=price*(-1) where price>0 and accept='취소'"
# Create a connection to the database file "mydb":
con = sqlite.connect("mydb")
cur = con.cursor()
f = open(outfile,'r')
for line in f:
print line
print "<br>"
cur.execute(line)
f.close()
#cur.execute(updateline)
con.commit()
print "<center>"
print "<br>"
print "데이타베이스에 자료가 입력되었습니다!!"
print "<br>"
print "<br>"
print "<a href=index.html>초기화면으로 </a>"
print "</center>"