pythondialog
is a module that enables you to print information in a ncurses-like interface. I want to use the Dialog.progressbox()
method to print output from a subprocess.Popen()
command.
The problem I'm facing is that progressbox()
will only print what's already there in the /tmp/TemporaryDialogFile
. It will not print new stuff that gets written to this file.
I want to know how I can get progressbox()
to continually display the growing output stream from youtube-dl
.This should be possible: the documentation says so.
Relevant code:
def openDialog():
d = Dialog(dialog="dialog")
d.set_background_title("Random title")
w = os.open("/tmp/TemporaryDialogFile", os.O_RDWR|os.O_CREAT)
os.chdir("/tmp")
p = subprocess.Popen(["youtube-dl", "-citw", channel_url], stdout=w, universal_newlines=True)
d.progressbox(file_path="/tmp/TemporaryDialogFile", text="youtube-dl output:")
This is what it should look like