import sqlite3 c = sqlite3.connect('history.db') c.execute("UPDATE human_sessions SET status='closed' WHERE status='active'") c.commit() print('ok')