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 |
Tags
- 정규표현식
- debian
- 노트패드뿔뿔
- PyLucene
- VM 호스트 주소
- Notepadplus
- firefox 파이어폭스
- SFTP
- ChatGPT
- springboot #spring #jackson
- 소스 <script> 로딩 실패
- Windows
- Notepad
- FTP
- OpenSCAD
- Python
- startfile
- python2.3
- 가상머신호스트
- Regex
- 임펠러
- sched
- PDFCreator
- 보안연결실패
- Printer Driver
- Notepad++
- 윈도우
- Basic Auth
- python 2.3
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>"