Code: try: connection = sqlite3.connect(os.path.join(os.environ['HOME'], '.rtcom-eventlogger', 'el-v1.db')) except: connection = sqlite3.connect(os.path.join(os.environ['HOME'], '.rtcom-eventlogger', 'el.db')) cursor = connection.cursor() cursor.execute('SELECT id FROM Events') id_array = cursor.fetchall() seq_id = max(id_array)[0] + 1
try: connection = sqlite3.connect(os.path.join(os.environ['HOME'], '.rtcom-eventlogger', 'el-v1.db')) except: connection = sqlite3.connect(os.path.join(os.environ['HOME'], '.rtcom-eventlogger', 'el.db')) cursor = connection.cursor() cursor.execute('SELECT id FROM Events') id_array = cursor.fetchall() seq_id = max(id_array)[0] + 1