]>
gitweb.pimeys.fr Git - scripts-20-100.git/blob - extract_ipython.py
2 # -*- encoding: utf-8 -*-
4 """ Pour récupérer le contenu de l'historique ipython """
16 sessionid
= "(SELECT max(session) FROM sessions) - %s" % (-n
)
20 req
= 'SELECT * FROM history WHERE session=%s;' % sessionid
23 history_file
= os
.path
.expanduser('~/.ipython/profile_default/history.sqlite')
25 c
= sqlite3
.connect(history_file
)
28 for line
in iter(r
.fetchone
, None):
29 print line
[-1].encode('utf-8')