GetComponents should not prompt in a Jupyter notebook

Create issue
Issue #2090 closed
Steven R. Brandt created an issue

GetComponents should only prompt if it is in a terminal and not in a Jupyter notebook. The following patch addresses this issue.


Comments (4)

  1. Roland Haas
    • changed status to open
    • removed comment

    Looks like a hack. Ideally one would not want to tie this to just jupyter yet it seems impossible to find out if the user could actually respond since jupyter insists on creating a tty (and then does not properly support it since once cannot read from stdin :-( ).

    There is a second change in there that now uses $answer instead of "no" in the default shown to the user. This involves no functional change since $answer has already been initialized to "no" at this point and is actually an improvement since it shows the actual default that will be used and not what the author of the code thinks that default was.

    So ok to apply to master only, please make this two commits, one for the $answer change, one for the jupyter support.

  2. Log in to comment