9308bb3504 | ||
---|---|---|
.. | ||
PyDroid3 | ||
ButtonClick.wav | ||
ButtonClick1.wav | ||
Demo_All_Widgets.py | ||
Demo_Animated_GIFs.py | ||
Demo_Bar_Chart.py | ||
Demo_Base64_Image_Encoder.py | ||
Demo_Borderless_Window.py | ||
Demo_Button_Click.py | ||
Demo_Button_Events_From_Browse.py | ||
Demo_Button_Func_Calls.py | ||
Demo_Button_States.py | ||
Demo_Button_Toggle.py | ||
Demo_Buttons_Base64_Simple.py | ||
Demo_Buttons_Mac.py | ||
Demo_Buttons_Nice_Graphics.py | ||
Demo_Calendar.py | ||
Demo_Canvas.py | ||
Demo_Change_Submits_InputText.py | ||
Demo_Chat.py | ||
Demo_Chat_With_History.py | ||
Demo_Chatterbot.py | ||
Demo_Chatterbot_With_TTS.py | ||
Demo_Color.py | ||
Demo_Color_Chooser_Custom.py | ||
Demo_Color_Names.py | ||
Demo_Color_Names_Smaller_List.py | ||
Demo_Column_And_Frames.py | ||
Demo_Column_Elem_Swap_Entire_Window.py | ||
Demo_Columns.py | ||
Demo_Compact_Layouts_Element_Renaming.py | ||
Demo_Compare_Files.py | ||
Demo_Control_Panel_Button_Grid.py | ||
Demo_Conways_Game_of_Life.py | ||
Demo_Crossword_Puzzle.py | ||
Demo_Cursor_Changed_To_Hand.py | ||
Demo_DOC_Viewer_PIL.py | ||
Demo_Debugger_Built_Into_PSG.py | ||
Demo_Debugger_Button.py | ||
Demo_Debugger_ImWatchingYou.py | ||
Demo_Design_Pattern_Multiple_Windows.py | ||
Demo_Design_Pattern_Multiple_Windows1.py | ||
Demo_Design_Pattern_Multiple_Windows2.py | ||
Demo_Design_Pattern_Multiple_Windows3.py | ||
Demo_Design_Pattern_Persistent_Window.py | ||
Demo_Design_Patterns.py | ||
Demo_Desktop_Floating_Toolbar.py | ||
Demo_Desktop_Widget_CPU_Dashboard.py | ||
Demo_Desktop_Widget_CPU_Graph.py | ||
Demo_Desktop_Widget_CPU_Utilization.py | ||
Demo_Desktop_Widget_CPU_Utilization_Simple.py | ||
Demo_Desktop_Widget_Email_Notification.py | ||
Demo_Desktop_Widget_Timer.py | ||
Demo_Desktop_Widget_psutil_Dashboard.py | ||
Demo_Disable_Elements.py | ||
Demo_DuplicateFileFinder.py | ||
Demo_EXE_Maker.py | ||
Demo_Email_Send.py | ||
Demo_Event_Binding.py | ||
Demo_Event_Callback_Simulation.py | ||
Demo_Fill_Form.py | ||
Demo_Floating_Toolbar.py | ||
Demo_Font_Previewer.py | ||
Demo_Font_Sizer.py | ||
Demo_Font_String.py | ||
Demo_Game_Frontend_Battleship.py | ||
Demo_Game_Frontend_Battleship_No_List_Comprehensions.py | ||
Demo_Game_Frontend_Battleship_Single_List_Comprehension.py | ||
Demo_GoodColors.py | ||
Demo_GoodColors_2.py | ||
Demo_Google_TTS.py | ||
Demo_Graph_Ball_Game.py | ||
Demo_Graph_Drag_Rectangle.py | ||
Demo_Graph_Drawing.py | ||
Demo_Graph_Drawing_And_Dragging_Figures.py | ||
Demo_Graph_Element.py | ||
Demo_Graph_Element_Sine_Wave.py | ||
Demo_Graph_Noise.py | ||
Demo_Graph__Element.py | ||
Demo_Graph_pymunk_2D_Graphics.py | ||
Demo_Hello_World.py | ||
Demo_HowDoI.py | ||
Demo_IP_Address_Entry.py | ||
Demo_Img_Viewer.py | ||
Demo_Input_Auto_Complete.py | ||
Demo_Input_Validation.py | ||
Demo_Invisible_Elements.py | ||
Demo_Keyboard.py | ||
Demo_Keyboard_ENTER_Presses_Button.py | ||
Demo_Keyboard_Realtime.py | ||
Demo_Keypad.py | ||
Demo_LED_Clock_Weather.py | ||
Demo_LED_Indicators.py | ||
Demo_Layout_Extend.py | ||
Demo_Layout_Generation.py | ||
Demo_Listbox_Search_Filter.py | ||
Demo_Look_And_Feel_Theme_Browser.py | ||
Demo_Look_And_Feel_Theme_Dump.py | ||
Demo_MIDI_Player.py | ||
Demo_Machine_Learning.py | ||
Demo_Matplotlib.py | ||
Demo_Matplotlib_Animated.py | ||
Demo_Matplotlib_Animated_Scatter.py | ||
Demo_Matplotlib_Browser.py | ||
Demo_Matplotlib_Browser_Paned.py | ||
Demo_Matplotlib_Embedded_Toolbar.py | ||
Demo_Matplotlib_Ping_Graph.py | ||
Demo_Matplotlib_Ping_Graph_Large.py | ||
Demo_Matplotlib_PyLab.py | ||
Demo_Matplotlib_Two_Windows.py | ||
Demo_Media_Player.py | ||
Demo_Media_Player_VLC_Based.py | ||
Demo_Menu_With_Toolbar.py | ||
Demo_Menus.py | ||
Demo_Multiline_Multicolored_Text.py | ||
Demo_Multiple_Windows_Experimental.py | ||
Demo_Multithreaded_Different_Threads.py | ||
Demo_Multithreaded_Logging.py | ||
Demo_Multithreaded_Long_Task_Simple.py | ||
Demo_Multithreaded_Long_Tasks.py | ||
Demo_Multithreaded_Multiple_Threads.py | ||
Demo_Nice_Buttons.py | ||
Demo_NonBlocking_Form.py | ||
Demo_Notification_Window_Alpha_Channel.py | ||
Demo_Notification_Window_Fade_In_Out.py | ||
Demo_Notification_Window_Multiprocessing.py | ||
Demo_OpenCV.py | ||
Demo_OpenCV_4_Line_Program.py | ||
Demo_OpenCV_7_Line_Program.py | ||
Demo_OpenCV_Draw_On_Webcam_Image.py | ||
Demo_OpenCV_Simple_GUI.py | ||
Demo_OpenCV_Webcam.py | ||
Demo_OpenCV_Webcam_ASCII.py | ||
Demo_OpenCV_Webcam_Minimal.py | ||
Demo_PDF_Viewer.py | ||
Demo_PNG_Thumbnail_Viewer.py | ||
Demo_PNG_Viewer.py | ||
Demo_Paned_Window.py | ||
Demo_Password_Login.py | ||
Demo_Pi_LEDs.py | ||
Demo_Pi_Robotics.py | ||
Demo_Ping_Line_Graph.py | ||
Demo_Pong.py | ||
Demo_Pong_Multiple_Platforms.py | ||
Demo_Popup_Custom.py | ||
Demo_Popups.py | ||
Demo_Progress_Meters.py | ||
Demo_PyGame_Integration.py | ||
Demo_PyGame_Snake_Game.py | ||
Demo_Pyplot_Bar_Chart.py | ||
Demo_Pyploy_Bar_Chart2.py | ||
Demo_Reddit_Search.py | ||
Demo_Save_Window_As_Image.py | ||
Demo_Script_Launcher.py | ||
Demo_Script_Launcher_ANSI_Color_Output.py | ||
Demo_Script_Launcher_Realtime_Output.py | ||
Demo_Script_Parameters.py | ||
Demo_Sort_Visualizer.py | ||
Demo_Spinner_Compound_Element.py | ||
Demo_Stdout.py | ||
Demo_Super_Simple_Form.py | ||
Demo_Table_CSV.py | ||
Demo_Table_Element.py | ||
Demo_Table_Pandas.py | ||
Demo_Table_Simulation.py | ||
Demo_Table_Simulation_Arrow_Keys.py | ||
Demo_Tabs.py | ||
Demo_Tabs_Nested.py | ||
Demo_Tabs_Simple.py | ||
Demo_Template.py | ||
Demo_Theme_Browser.py | ||
Demo_Theme_Dump.py | ||
Demo_Timer.py | ||
Demo_Touch_Keyboard.py | ||
Demo_Tree_Element.py | ||
Demo_Turtle.py | ||
Demo_Unicode_Characters.py | ||
Demo_Uno_Card_Game.py | ||
Demo_Window_Disappear.py | ||
Demo_YouTube_Intro.py | ||
Demo_Youtube-dl_Frontend.py | ||
Demo_psutil_Kill_Processes.py | ||
TutorialCPUUtilization.py | ||
db.sqlite3 | ||
default_icon.ico | ||
ping.py | ||
readme.md |
readme.md
PySimpleGUI Demo Programs
One Stop Shopping For Templates and Techniques
This folder of over 170 programs is your jump-start, spring board, boost, shove in the back, cheat sheet to get you to a solution as quickly as possible. You can think of them as Recipes from a large PySimpleGUI Cookbook.
Programs in this folder have a range of uses and reasons for existing
- Demonstrate a particualar PySimpleGUI Element / Feature (Tables, Trees, Buttons)
- Design patterns are "official" ways to get something done (Multiple windows)
- Integrate PySimpleGUI with another package / technology (OpenCv, Matplotlib)
- Assemble PySimpleGUI elements in a useful way (Bar graphs, games)
- Additional user code that enable new functionality (ANSI color strings)
- How to deal with common GUI problems (work requiring lots of time)
Coding Conventions
Special attention is given to the programs in this folder to ensure they conform to the latest "preferred" technique or naming convention. In the past, when technique changed, so did all of these demo programs. For example, the use of the FindElement
method was replaced by using [ ]
. All of these Demo Programs were updated to use the new convention.
For example, this line of code:
window.FindElement('status').Update(event)
was replaced with:
window['status'].Update(event)
There was a recent sweep through all of the Demo Programs where all code was changed to use the PEP8 naming conventions / bindings. All calls to Window.Read()
were changed to window.read()
PySimpleGUI is on a swift development path. In a short amount of time a lot can change. To help ensure that users are using the latest, preferred, methods of using the PySimpleGUI package, these Demo Programs are the vehicle in which to communicate the latest design patterns.
Ports
Not all of the programs presented here are limited to the tkinter port of PySimpleGUI. Some programs show multiple import statements with some that are commented out. This is done to show you that the code is capable of running more than 1 platform. This example is from the Demo_Matplotlibe_Two_Windows.py file
from matplotlib import use
# import PySimpleGUI as sg
import PySimpleGUIQt as sg; use('qt5agg')
This indicates that the code can be run on either the tkinter or the Qt port. To switch ports, uncomment the one you want to run on and comment out the others.
Running Demos Online
Recently two online Pyuthon services have been used to demonstrate using PySimpleGUI- Trinket & repl.it. You will find not only some of the Demo Programs from this folder on these sites, but other demo programs as well. They make good "scratch pads" for posting PySimpleGUI code. They are superior to Pastebin because not only can you share your code, but people can run the code without having to install or do anything locally.
Trinket
If a demo does not require another package be installed and it's not specific to a particular platform then there's a possibility that it can be run online using Trinket. You'll find a number of these Demo Programs have been added to the PySimpleGUI Trinket pages.
The benefits of using Trinket include
- No need to install PySimpleGUI or even Python on your local machine
- Additional explanation can be included with the code, including images
You'll find the demos that have been added to Trinket here:
http://Trinket.PySimpleGUI.org
Repl.it
Prior to discovering Trinket PySimpleGUI demo programs were being hosted online on repl.it. Repl.it has several advantages over Trinket including:
- Able to run both PySimpleGUI and PySimpleGUIWeb programs
- Can use other packages with PySimpleGUI
- Can pip install specific PySimpleGUI versions to use
You'll find a list of repl.it demos here:
These programs may not be the most up to date and in fact are likely to contain old coding constructs and examples. As a result, use them more of a demonstration of "what's possible" rather than "exactly how to do it".
Support
These programs are not "officially" part of the PySimpleGUI code. They are not installed when you do a pip install for example.'
They are demonstrations, examples, and as a result may not be fully built-out, completed programs. In order to keep the code simple, they may not have all of the error checking that your program should have.
If you encounter a problem where a demo no longer functions, you are of course encouraged to open an Issue on the GitHub.
If you encounter more subtle problems, you should take into account that these programs are demonstrations, not end-user products. For example, if an image viewer application doesn't display all types of image files ilke JPGs, then that's more than likely a limitiation that the underlying GUI Framework has rather than a bug. In this example, it's your repsonibility to figure out how to convert your images into a format that's understod by the framework rather than an improvement needed in the demo program that will show you how to do that.
Author
The PySimpleGUI Organization and PySimpleGUI users
If the code has been provide by a PySimpleGUI user, then the comments at the top of the progrm will indicate the author.
License
Copyright 2019 PySimpleGUI.org
GNU Lesser General Public License (LGPL 3) +