Re: [Rdkit-discuss] Suppress stdout and stderr in rdkit

2016-02-18 Thread Gaetano Calabro
Hi Paolo, Thanks a lot for your prompt reply. I ended up coding this: from rdkit import Chem from rdkit import RDLogger smart = '[#6]1(:[#6]:[#6]:[#6]2:[#6](:[#6]:1):[#6]:[#6]:[#6]:[#6]:2)-[#8,#6]' mol = Chem.MolFromSmarts(smart) lg = RDLogger.logger() lg.setLevel(RDLogger.CRITICAL) try:

Re: [Rdkit-discuss] Suppress stdout and stderr in rdkit

2016-02-18 Thread Paolo Tosco
Dear Gaetano, you may try the following: from rdkit import rdBase rdBase.DisableLog('rdApp.error') You may check the logging levels you wish to disable/enable in rdkit/RDLogger.py, or use a wildcard such as 'rdApp.*' to affect all levels at once. Best, Paolo On 17/02/2016 23:54, Gaetano

[Rdkit-discuss] Suppress stdout and stderr in rdkit

2016-02-17 Thread Gaetano Calabro
Hi there, I wonder if there is an easy way to suppress the standard output and standard error from RDkit. For example: from rdkit import Chem smart = '[#6]1(:[#6]:[#6]:[#6]2:[#6](:[#6]:1):[#6]:[#6]:[#6]:[#6]:2)-[#8,#6]' mol = Chem.MolFromSmarts(smart) Chem.SanitizeMol(mol) This will