NLTK provides a feature that allows you to "draw" tree structures, e.g. a dependency parse. In practice, when you call tree.draw()
, a windows will pop up (on Windows at least) with the drawn tree. Even though this is nice functionality, it also blocks, meaning that the execution of a script is blocked when the tree is drawn until you close the window of the newly drawn tree.
Is there any way to draw trees in a non-blocking way, i.e. without them stopping a script's execution? I have thought about starting a separate process in Python that is responsible for drawing the trees, but perhaps there is a more straightforward way.