How to log everything that occurs in a Python interactive shell session?

后端 未结 5 1496
小蘑菇
小蘑菇 2021-01-05 09:23

I\'d like to have real-time access to both interpreter input and error and standard output. Preferably this information would be written to a file, so that I can poll the fi

5条回答
  •  一向
    一向 (楼主)
    2021-01-05 09:42

    You can try and use my logging tool. It's not perfect yet but it solved my problem, which seems similar to your.

    https://github.com/hholst80/loginteractive

    It works by using LD_PRELOAD to pipe stdin.txt (or $STDIN) to stdout. It works for python and octave, although I have not tested it that much yet.

提交回复
热议问题