Dear Community,
we are executing some Metashape methods using the Python API.
As we are facing a large amount of console output:
Is there any way to suppress the console output somehow? (Maybe with redirection to a file?)
Best,
Martin
********************
Anyway, I found the following in the depth of the internet.
It generally works, but NOT with the Metashape module.
class suppress_stdout:
def __enter__(self):
self.old_stdout = sys.stdout
sys.stdout = StringIO() # Leerer Puffer für die Standardausgabe
return self
def __exit__(self, exc_type, exc_val, exc_tb):
sys.stdout = self.old_stdout