Is it possible to redirect Python print command output to FreeCAD output window?
It is common practice to use print for exceptions information handling. But print produce only "I/O error"
Andrey
print from Python
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
Re: print from Python
We could turn on the stdio on the report window, but unfortunnately a lot libs we use have a lot of noice on stdio. So a lot
more would show of when we did that....
Im not digged that deep into python to see if we get a hold on only the python output....
more would show of when we did that....
Im not digged that deep into python to see if we get a hold on only the python output....
Stop whining - start coding!
Re: print from Python
Actually it is not a bad idea to print Python errors directly to the output console because it often contains useful information to track down a problem...
Technically this no problem because we already have implemented this feature for our Python console. All what we need to do is to write a new Python extension class with a certain interface and overriding the sys.stderr object. Maybe we could put an option in the preferences which is off by default because the output could be really verbose.
Technically this no problem because we already have implemented this feature for our Python console. All what we need to do is to write a new Python extension class with a certain interface and overriding the sys.stderr object. Maybe we could put an option in the preferences which is off by default because the output could be really verbose.
Re: print from Python
The redirection feature for Python errors is implemented.