Feature request #8343
Incremental output in python console
Status: | Closed | ||
---|---|---|---|
Priority: | Low | ||
Assignee: | - | ||
Category: | Python plugins | ||
Pull Request or Patch supplied: | No | Resolution: | |
Easy fix?: | No | Copied to github as #: | 17127 |
Description
It would be great if the Python console showed script output as it were produced by the script, rather than waiting until the script finishes to display the output. This would allow one to monitor the progress of a script more easily. Also, if a script generates an exception, the exception is displayed at the top, above all of the output, which makes it hard to see that there has been an error if the script generates a lot of output.
UPDATE (duplicating bug because I couldn't reopen the old one #8270):
In a nightly build from a few days ago I see that exceptions are now displayed below output but I don't see incremental output. For example, when I run
import time for i in xrange(3): time.sleep(1) print i
in the console, the script waits three seconds and then prints
0 1 2
rather than waiting 1 second, printing 0, waiting another second, printing 1, etc.
Associated revisions
Update console_output.py
Call QCoreApplication.processEvents() after writing to Python console, enabling incremental output from Python scripts. Fixes #8343.
Make console printing safe
References #8343 https://issues.qgis.org/issues/8343
History
#1 Updated by Alexander Dunlap over 11 years ago
This can be fixed by adding QCoreApplication.processEvents()
in the writeOut.write
method in console_output.py
.
#2 Updated by Alexander Dunlap over 11 years ago
Pull request submitted: https://github.com/qgis/Quantum-GIS/pull/779
#3 Updated by Nathan Woodrow over 11 years ago
- Status changed from Open to Closed
Fixed in changeset 1302ecbedff147915b170e2d05eb4c8bb3e5ac0b.