r/PySimpleGUI

114 archived posts · Jan 2019 – Jul 2020

Random post

u/MikeTheWatchGuy•

While this r/PySimpleGUI subreddit is winding down, it doesn't mean the project is.

This seems like a fitting post to wrap things up here... add a starting place at the ending place.

This animation provides a 4 minute overview of what PySimpleGUI is and how it works. Quick and entertaining as the goal.

https://youtu.be/36BdjuNcQJ4

The code presented in the video is this simple GUI:

# Section 1 import
import PySimpleGUI as sg

# Section 2 layout
layout = [[sg.Text('Enter something:'), sg.Input(key='-IN-')],
          [sg.Text('Out output will go here',key='-OUT-', size=(30,1) )],
          [sg.Button('Ok'), sg.Button('Exit')]]
90

u/MikeTheWatchGuy•

This r/PySimpleGUI subreddit is being "retired".

There are some good posts so rather than make the sub private and thus entirely inaccessible, I'm marking it as "restricted".

Of course you can continue to get support for your PySimpleGUI project on the project's GitHub page (http://www.PySimpleGUI.com). Simply file an issue.

63

u/norambna•

As stated in the PySimpleGUI documentation, PyInstaller works like a charm. I would only add the --windowed option, so that PyInstaller builds an OS X .app bundle that doesn't open a terminal window. Otherwise, it works fine. Thanks!

 

edit: I finally had to ditch PyInstaller. The "application bundle" made by PyInstaller runs on the computer where you make it, but it doesn't work on other computers. I tried to look into it, but there seem to be tons of issues with MacOS and tkinter.

I switched to py2app, followed the [tutorial](https://py2app.readthedocs.io/en/latest/tut

58

u/areolys•

There are two things I'd like to change / add to the current CalendarButton, or rather the Datepicker itself:

First, I'd like the week to start on Monday, instead of Sunday.

Second, I'd like to highlight a date based on the target input.
(if target is empty, select today's date.)

​

I'm still new to Python (4 months coding on the side).
For the first option I did find line # 2521 in PySimpleGUI.py that seems to control the start day. However, I have no idea how I could override that part and add in the date highlight without messing things up...

Any help would be greatly appreciated!

Thanks!

31

u/R_Sachin•

Hi Mike,

Firstly, I want to thank you for creating such wonderful and simply great PySimpleGUI module for GUI!

I am Sachin, student , as part of my academic project building scientific tool. I am new to Python and GUI development. I have been using your PySimpleGUI module since from last 3 months. I have gone almost all your demo codes for various features.

Now that i have created a GUI(Just assume that its like calculator with no of buttons) which has the menu buttons features(Manual, Help, FAQ, at least 5 such buttons) and which have the functionality: when you click it a PDF file should open to view the information.

So far its okay i am perfectly able to implement. Now that i have

38

u/_Iv•

I am working on a project with PySimpleGUI, and one of my inputs is a Spin element. I have set enable_events=True for the element, so when I click an increment arrow, I see my function run. This is all good and well.

However, I am wondering if it is possible to receive a Spin event for when the user types in a new value into the Spin element, instead of using the increment arrows.

34

u/The-Faux•

So, I'm currently about to end a school project, where we have to make a GUI off of a CLI application (we chose ping, it's simple and you can have fun with it), so I introduced myself to Graph. I made a somewhat neat graph (Thank you tutorials, thank you cookbook, thank you GitHub demos) with x- and y-axis.

While that is nice and all, once you go past 500 pings, I've implemented a graph.move which moves it everything, giving it a nice flow.

Now, my question to you guys is like the title states: Are you able to keep the x- and y-axis 'static' whilst utilizing graph.move()? Obviously I can keep redrawing the axis, but I think it would slow down the program as well as create nasty lines where

323

u/dave3652•

Hi, I've been using your gui for past few months, it's great, tried tk previously but found it tough! I've been trying to print some football results using Sg.Text and various forms of formatting it to make it look good.. cant get the text to align.. not sure if I remember reading years ago that tk made it hard to format text. All that I am trying to do is the display the home team name , the score and away team name. Everton 1 2 Man utd Crystal palace 1 3 Chelsea Something like that. Everything I've tried fails to line it up. Is it a tk problem?

Thanks

33

u/MikeTheWatchGuy•

PySimpleGUI (tkinter version) Release 4.3 is out

This is a rather significant release for a couple of reasons.

  1. All interfaces have been made PEP8 compliant while retaining the original CamelCase definitions
  2. Better layout controls.
    • Container Elements can have contents justified left, right & center.
    • Windows have a justification setting that will apply to all Window-level elements
  3. New Sizer element that will fill out your containers to the size specified by the Sizer

Here are the full release notes:

4.3 PySimpleGUI Release 22-Aug-2019

PEP8 PEP8 PEP8 Layout controls! Can finally center stuff Some rather impactful changes this time Let's hope it doesn'

33

u/Watup_My_dudes•

Sorry my code is very long and messy. As of now the outputs in AllFunk() show up in a seperate window (Popup). Is there any easy way to get them to all show up as part of the initial window (the one with the inputs) like Pattern 2 B here : https://pysimplegui.readthedocs.io/en/latest/index_worked/#pattern-2-a-persistent-window-multiple-reads-using-an-event-loop . I want to be able to have the AllFunk() outputs show in the same window as the inputs and update like the character reader in the linked code.

import PySimpleGUI as sg

# INPUTS - - - - - - - 
39

Great package, couldn't be simpler, but is there a way to call a different layout? It's super easy to create a one screen form, but what about moving to another screen? Would that require running a different python program, with a different window?

For example, order entry app, screen 1 includes name/address, screen 2 is new order, screen 3 is edit order, screen 4 is delete order, screen 5 is past orders, etc.

I can't tell if this package was designed to actually build gui applications or just to create one quick screen for minor things.

31