Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Answering Yes/No shell prompt on notebook

I'm running a shell execute command in a notebook (Google Collaboratory), and such command prompts me to give a yes/no answer. How can I respond to this prompt shell message within the notebook?

like image 660
Ricardo Barros Lourenço Avatar asked Mar 22 '18 14:03

Ricardo Barros Lourenço


People also ask

Where is jupyter_ notebook_ config?

Check to see if you have a notebook configuration file, jupyter_notebook_config.py . The default location for this file is your Jupyter folder located in your home directory: Windows: C:\Users\USERNAME\. jupyter\jupyter_notebook_config.py.


1 Answers

Update: Colab now supports input prompts, so you should see these immediately, e.g.,

enter image description here

Old answer: A typical pattern is to run the command without prompts, if it has such an option. For example, for installation using apt, provide the option -y.

If no such option exists, you can do something like piping yes to the program like so: yes | programThatHasConfirmationPrompts.

like image 95
Bob Smith Avatar answered Sep 20 '22 03:09

Bob Smith