From 91292820e39f1cea0bcec57434d7dbb1c5e68ed3 Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Sat, 18 Oct 2014 14:32:00 +0200 Subject: [PATCH] =?utf8?q?Pour=20dumper=20la=20derni=C3=A8re=20session=20i?= =?utf8?q?python?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- extract_sess.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 extract_sess.py diff --git a/extract_sess.py b/extract_sess.py new file mode 100755 index 0000000..c7c2016 --- /dev/null +++ b/extract_sess.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python + +import sqlite3 +import os + +c = sqlite3.connect(os.path.expanduser('~/.ipython/profile_default/history.sqlite')) + +r = c.execute('select * from history where session=(select max(session) from sessions);') + +for line in iter(r.fetchone, None): + print line[-1].encode('utf-8') -- 2.39.2