mrkn / pycall.rb

Calling Python functions from the Ruby language
MIT License
1.05k stars 72 forks source link

Catching python STDOUT #160

Open cboulanger opened 1 year ago

cboulanger commented 1 year ago

Hi, thank you for this incredibly useful gem.

I have a question/feature request: I would like to "mute" the STDOUT output of python and handle it with ruby code (e.g., write it to a log file). Redirecting $stdout on the ruby side does not seem to work (seems logical since python has writes directly to STDOUT). In case this cannot already be handled py PyCall, would this be feature that you would consider implementing? It would probably require injecting some python code to set up the redirection.