· 9 years ago · Jan 23, 2017, 09:58 AM
1def Create(arg, *args):
2 try:
3 conn = sqlite3.connect('D:\Projects\workspace\Tutorial1\Example.db')
4 except Exception as e:
5 print e
6 try:
7 with conn:
8 c = conn.cursor()
9 for arg in args:
10 query = "create table if not exists %s(Id INTEGER PRIMARY KEY, Title text, Content text)"% arg
11 conn.execute(query)
12 conn.commit()
13 print "Table is created"
14 except Exception as e:
15 print e, "is occurred in Create"
16 conn.close()