req = 'SELECT * FROM history WHERE session=%s;' % sessionid
#print req
-history_file = os.path.expanduser('~/.ipython/profile_default/history.sqlite')
+
+history_file = os.path.expanduser('~/.config/ipython/profile_default/history.sqlite')
+if not os.path.isfile(history_file):
+ history_file = os.path.expanduser('~/.ipython/profile_default/history.sqlite')
c = sqlite3.connect(history_file)
r = c.execute(req)