SQLite2 [SQLite] 파이썬 데이터베이스 연동(2), 테이블 조회, 수정, 삭제 테이블 조회하기 #파이썬 데이터베이스 연동(SQLite) import sqlite3 from sqlite3.dbapi2 import connect conn = sqlite3.connect('/mnt/c/Users/mch12/Documents/python_basic/resource/database.db') #커서 바인딩 c = conn.cursor() #데이터 조회 c.execute("SELECT * FROM users") #커서 위치가 변경 #1개 로우 선택 # print('One -> \n', c.fetchone()) #지정 로우 선택 # print('Three -> \n', c.fetchmany(size=3)) rows = c.fetchall() for row in rows: print('retrie.. 2021. 11. 5. [SQLite] 파이썬 데이터베이스 기본 연동, 테이블 생성, 데이터 삽입 SQLiteDatabaseBrowserPotable 다운로드 하기(https://portableapps.com/apps/development/sqlite_database_browser_portable) db browser실행 DB생성 & Auto Commit conn = sqlite3.connect('본인디렉터리의절대경로/resource/database.db', isolation_level=None) #파이썬 데이터베이스 연동하기 import sqlite3 #DB생성 & Auto Commit conn = sqlite3.connect('본인경로/python_basic/resource/database.db', isolation_level=None) DB브라우저에서 열기 만든 데이터베이스를 선택해 줍니다. 커.. 2021. 11. 4. 이전 1 다음