Image Display
image1.py
import PySimpleGUI as PSG rows = [ [PSG.Image("atari.gif")] ] form = PSG.FlexForm("This is a form.") form.Layout(rows) button, value = form.Read()
image2.py
import PySimpleGUI as PSG myImage = PSG.Image("heads.png") rows = [ [myImage], [PSG.ReadFormButton("Swap image")] ] form = PSG.FlexForm("This is a form.") form.Layout(rows) button, value = form.Read() if button == "Swap image": myImage.Update("atari.gif")
image3.py
import PySimpleGUI as PSG message = PSG.Text("Welcome") rows = [ [message], [PSG.ReadFormButton("Atari",image_filename="atari.gif")] ] form = PSG.FlexForm("This is a form.") form.Layout(rows) button, value = form.Read() if button == "Atari": message.Update("Clicked on Atari")
Using the cards, coins or dice resources available on this website:
- Can you create a Heads or Tails coin flipper?
- Can you create a random Card Draw app?