LoginSignup
1
1

More than 1 year has passed since last update.

#python のインタラクティブモードでのコマンド履歴を全て表示する ( readline )

Last updated at Posted at 2019-05-10

Answer

$ cat ~/.python_history

or

$ python

import readline
for i in range(readline.get_current_history_length()):
    print (readline.get_history_item(i + 1))

how do you see the entire command history in interactive python? - Stack Overflow

ipython

$ sqlite3 ~/.ipython/profile_default/history.sqlite --batch 'SELECT source_raw FROM history'

インタラクティブモード内でマジックコマンドも利用可能

%history
%history -g

Original by Github issue

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1