#connect to db
sqlite_conn = sqlite3.connect("image_link.db")
sqlite_conn.text_factory = str
#get cursor
cursor = sqlite_conn.cursor()
#create table
cursor.execute('''create table if not exists sexygirl(id integer primary key,urlstring text)''')
fh = open("beauty.txt")
index = 0
for line in fh.readlines():
if len(line):
index = index +1;
dic = (line,);
cursor.execute("select * from sexygirl where urlstring = ?",dic)
rows = cursor.fetchone()
if rows:
{}
else:
cursor.execute("insert into sexygirl values(?,?)",(index,line))
sqlite_conn.commit()
sqlite_conn.close()
sqlite_conn = sqlite3.connect("image_link.db")
sqlite_conn.text_factory = str
#get cursor
cursor = sqlite_conn.cursor()
#create table
cursor.execute('''create table if not exists sexygirl(id integer primary key,urlstring text)''')
fh = open("beauty.txt")
index = 0
for line in fh.readlines():
if len(line):
index = index +1;
dic = (line,);
cursor.execute("select * from sexygirl where urlstring = ?",dic)
rows = cursor.fetchone()
if rows:
{}
else:
cursor.execute("insert into sexygirl values(?,?)",(index,line))
sqlite_conn.commit()
sqlite_conn.close()