-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Supress cpymad output to stdio #15
Comments
Hey, redirecting the MAD-X output to an arbitrary file handle can be achieved as follows:
See also the code in MadGUI. I admit, this is a bit hacky and the documentation is almost nonexisting. Probably its a common demand and should be made easier or at least documented. I'll try to add something as soon as I get some time (currently busy with something else, sorry). Hope, this helps. EDIT Sorry, had to correct some minor inconsistencies in the original code. |
I guess I will patch the |
Okay, took me a bit longer to find some time to do this. You can now simply do m = Madx(stdout=False)
# or
with open('log.txt', 'w') as f:
m = Madx(stdout=f) I uploaded a new release on PyPI. Let me know if you have any problems. Best regards, |
Thanks! That works great for me! |
When doing parameter sweeps, the output of madx pollutes the standard output.
I have looked and found no way in the documentation to suppress or redirect that output.
The text was updated successfully, but these errors were encountered: