Turn off print messages in NEURON
Moderator: hines
Turn off print messages in NEURON
When using NEURON from Python, I get lots of printed messages that I don't really want to see. If they originate from the NEURON python module, I am able to intercept them and redirect from stdout to another buffer that I can check later (if needed). But the ones coming from the C libraries I am having trouble catching, and they are cluttering up all of my stdout. Is there a way to configure neuron (maybe from an environment variable) to turn off all stdout originating from C?
Re: Turn off print messages in NEURON
With the most recent master from github, all (or at least most) of printf in c is redirected to the python stdout (if python is the launched program).
This was done so that all output with jupyter notebooks goes to the notebook.
Note that the statement that actually does the printing is line 687 of nrn/share/lib/python/neuron/__init__.py
Is this the stdout that you redirected?
This was done so that all output with jupyter notebooks goes to the notebook.
Note that the statement that actually does the printing is line 687 of nrn/share/lib/python/neuron/__init__.py
Code: Select all
sys.stdout.write(s.decode())
Re: Turn off print messages in NEURON
I was using NEURON 7.5 so I don't think I had this functionality yet. It seems likely that I will be able to redirect stdout as needed entirely with Python calls in NEURON 7.6, since this commit https://github.com/neuronsimulator/nrn/ ... 2f80226f62, which contains the code you described, is tagged with 7.6.0. Thank you!