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 | 31 |
Tags
- linux ssh root debian
- 보안연결실패
- Regex
- PDFCreator
- 정규표현식
- Basic Auth
- react #router
- SFTP
- PyLucene
- OpenSCAD
- Printer Driver
- springboot #spring #jackson
- 윈도우
- 임펠러
- Windows
- 가상머신호스트
- React #React-Table
- cifsutils
- Notepad
- 소스 <script> 로딩 실패
- debian
- firefox 파이어폭스
- Notepad++
- VM 호스트 주소
- FTP
- Notepadplus
- mailutils
- startfile
- 노트패드뿔뿔
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>"