From 8406758d1c048525ab9cbeb440ebcf8851da9e4d Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Mon, 24 Feb 2020 14:15:48 -0500 Subject: [PATCH] Demo program to show how shell_with_animation works --- ...ltithreaded_Long_Shell_Operation_Animated.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 DemoPrograms/Demo_Multithreaded_Long_Shell_Operation_Animated.py diff --git a/DemoPrograms/Demo_Multithreaded_Long_Shell_Operation_Animated.py b/DemoPrograms/Demo_Multithreaded_Long_Shell_Operation_Animated.py new file mode 100644 index 00000000..2a7c2a1d --- /dev/null +++ b/DemoPrograms/Demo_Multithreaded_Long_Shell_Operation_Animated.py @@ -0,0 +1,17 @@ +import PySimpleGUI as sg + +""" + Demo shell_with_animation call + + This is a high-level function that could easily live in user's code instead of PySimpleGUI. The + rationale for bringing it into PySimpleGUI is to encourage users to experiment with working with + more external tools like ffmpeg. The shell_with_animation function allows users to easily start + a long-operation without fearing that the GUI will appear to be frozen. It offers a wide range + of parameters to help create a custom animation window. +""" + +# Here we're running a simple "pip list" command and using the built-in animated GIF. + +output = sg.shell_with_animation('pip', 'list', message='Loading your pip list', background_color='white', text_color='red', font='Helvetica 15') + +sg.popup_scrolled(output, font='Courier 10')