Python Forum
[PySimpleGUI] New GUI Package. Customize with ease
Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PySimpleGUI] New GUI Package. Customize with ease
#23
(Aug-19-2018, 03:27 PM)Axel_Erfurt Wrote:
(Aug-17-2018, 10:45 PM)PySimpleGUI Wrote: My goal is to put GUIs into the hands of beginners in their first week of coding.
My motto is: first learn the basics. If the beginners then see a code with tkinter, they understand nothing.
Exactly!

Learn the basics about how a GUI can be used and works, then when they can understand more advanced, look at tkinter or some other framework. PySimpleGUI is not a detour from tkinter, it's on the way to tkinter.

Have you looked at PySimpleGUI and tried to make a sample GUI? You're making it sound like it's a lot of work to learn and use. It's a nothing investment for a GUI outcome. Not understanding at all the pushback for using it.

1,000's of people are using EasyGUI. Do you think it's a waste for people to use it too? If there wasn't a need, EasyGUI wouldn't get 100s of installs a day despite it not being maintained for a long time.

It's not just beginners using PySimpleGUI.

The folks making the PyMuPDF are using it for their utilities. One of the engineers sent me this PDF reader today. A few lines of code and you're able to preview a PDF file. Not all developers are super-strict, no outside of core-packages until the basics are all down. Some just want to get the job done. A basic GUI that's running is a lot better than a tkinter GUI that is given up on.


import sys
import fitz
import PySimpleGUI as sg
fname = sys.argv[1]
# fname = 'C:/Python/PycharmProjects/GooeyGUI/test.pdf'
doc = fitz.open(fname)
title = "PyMuPDF display of '%s' (%i pages)" % (fname, len(doc))

def get_page(pno):
    pix = doc[pno].getPixmap(alpha = False)
    return pix.getPNGData()

form = sg.FlexForm(title)

data = get_page(0)
image_elem = sg.Image(data=data)
layout = [  [image_elem],
            [sg.ReadFormButton('Next'),
             sg.ReadFormButton('Prev'),
             sg.ReadFormButton('First'),
             sg.ReadFormButton('Last'),
             sg.Quit()]  ]

form.Layout(layout)

i = 0
while True:
    button,value = form.Read()
    if button in (None, 'Quit'):
        break
    i -= 1 * button == 'Prev'
    i += 1* button == 'Next'
    i = 0 if button =='First' else -1 if button == 'Last' else i
    try:
        data = get_page(i)
    except:
        i = 0
        data = get_page(i)
    image_elem.Update(data=data)
Reply


Messages In This Thread
RE: [PySimpleGUI] New GUI Package. Customize with ease - by PySimpleGUI - Aug-19-2018, 03:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PySimpleGUI Try Except jamesaarr 1 1,991 Nov-18-2021, 02:02 PM
Last Post: jamesaarr
  [PySimpleGUI]Install package on Conda not up-to-date RayJohnson 4 4,555 Jan-22-2020, 11:17 PM
Last Post: RayJohnson

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020