admin管理员组文章数量:1310415
The python3
REPL on macos ventura (chip m1) store the interactive shell history one file per session. At the end of the week I found myself with many hidden files in $HOME
: one .python_history
, dozens of .python_history-12345.tmp
, where 12345
can be any sequence of 5 digits.
Here the exact sequence of operations:
$ rm .python_history*
$ python3
Python 3.10.1 (main, May 2 2022, 14:56:30) [Clang 13.1.6 (clang-1316.0.21.2.3)] on darwin
>>> x = 5
>>> quit()
$ python3
>>> y = 44
>>> quit()
$ ls .python_history*
.python_history .python_history-57028.tmp
The content of .python_history
is always the log of the first session. The content of the other is the concatenation of the original one and the last session.
Looking for solutions I found many suggestions like this one which has for goal to disable the history.
I don't want that.
Is there a way to force different sessions to continue appending to the original log file?
本文标签: pythonMultiple pythonhistory filesStack Overflow
版权声明:本文标题:python - Multiple .python_history files - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741833147a2400056.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论