Use Prompt while Progress/Live is running #1164
-
I cannot work out how to ask a question during a long-running task - I've tried making from rich.prompt import Confirm
from rich.progress import track
for s in track(['hello', 'world']):
if not Confirm().ask('Continue?', default=True):
break Prints something like:
The escape codes aren't a bad paste - they appear visibly in the terminal. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hey! First of all, thanks for a great tool. I am also very much interested in this! I've been furiously googling to find a way of doing this, to no avail. |
Beta Was this translation helpful? Give feedback.
-
I'm afraid that Confirm and track will not work together. Confirm calls the system input() which assumes it has complete control over the terminal. I am working on more dynamic features for Rich, so you may be able to do something like this in the future. |
Beta Was this translation helpful? Give feedback.
I'm afraid that Confirm and track will not work together. Confirm calls the system input() which assumes it has complete control over the terminal.
I am working on more dynamic features for Rich, so you may be able to do something like this in the future.