기본 콘텐츠로 건너뛰기

라벨이 sqlite3인 게시물 표시

python sqlite3 db 생성하기

python-sqlite3.html import  sqlite3 # test db(file name) # :memory: means RAM db  =  '''test_db''' sql_t_person  =  '''create table person (name text)''' def  main ():      con  =  sqlite3 . connect ( db )      con . isolation_level  =  None  # autocommit      cur  =  con . cursor ()      # create test_db      cur . execute ( sql_t_person )      cur . close ()      return  0 if  __name__  ==  '__main__' :  main ()