Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Announcements #142

Open
MikeTheWatchGuy opened this issue Sep 6, 2018 · 1,073 comments
Open

Announcements #142

MikeTheWatchGuy opened this issue Sep 6, 2018 · 1,073 comments

Comments

@MikeTheWatchGuy
Copy link
Collaborator

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 6, 2018

Announcements - New Features, Design Patterns, and Methods

I'm unsure how GitHub sends out updates. I don't think people are informed about Wiki changes for example. I've been announcing new features and more importantly, new ways of doing things, on the Wiki. I'm going to put announcements here so they are more visible. If there are objections about the traffic, well, what can I say, it's a busy/active project.

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 6, 2018

New use pattern - Element lookup using Keys

keys can be used to lookup Elements. As a result, all Elements are capable of having a key, including non-output elements such as a Text Element.

To get an element object from a form, you call
form.FindElement(key)

This is the new, preferred method for doing Updates on elements.

Previously if you wanted to output something to a Text Element, you needed to create the text element outside of the form layout and keep that text element variable around so you can call text_element. Update('new text')

The new design pattern is thus:
In your form layout, include a key on your Element:

layout = [[sg.Text('My text', key='text')]]

Later in your code you can update this Text Element by making this call, assuming the variable form is your FlexForm object:

form.FindElement('text').Update('new text')

The Demo programs have all been updated to use this new technique. This capability and its impact on the length of programs led to pushing version 2.30 out the door quickly.

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 6, 2018

Borderless Windows are Here

Try them on your next form.
Add this to your FlexForm call:
no_titlebar = True

You can expect to see some of these in the Demo programs.

borderless grayed buttons

You can click anywhere on the window and drag to move it. Don't forget to put an exit key on these windows.

Be sure and make an "exit" button or you'll be running task manager to close your windows. The reason is the when you turn on this option, you will not see an icon on your taskbar for the window. This happens on both Windows and Linux. Thus, if you do not supply an exit button, the user will have no means to close the window.

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 7, 2018

Grab Anywhere

Tonight's change is perhaps going to be a really cool thing or one that is going to piss people off.

But, hey, I like it this way. If you don't, setgrab_anywhere = Falsein your call to FlexForm.

As the name implies, you can grab and drag your window using any point on the window, not just the title bar. I was only enabling this when the title bar was turned off. I think it's a much superior way to interact with a window.

FlexForm is becoming quite the call!
def __init__(self, title, default_element_size=DEFAULT_ELEMENT_SIZE, default_button_element_size = (None, None), auto_size_text=None, auto_size_buttons=None, scale=(None, None), location=(None, None), button_color=None, font=None, progress_bar_color=(None, None), background_color=None, is_tabbed_form=False, border_depth=None, auto_close=False, auto_close_duration=DEFAULT_AUTOCLOSE_TIME, icon=DEFAULT_WINDOW_ICON, return_keyboard_events=False, use_default_focus=True, text_justification=None, no_titlebar=False, grab_anywhere=True):

So, enjoy a lazy way of interacting with windows on me.

You will want to turn if off for forms with a SLIDER. you need the slider to move, not the window. I'll update the Demos that use sliders to turn off the grab_anywhere.

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 7, 2018

Tables

This one has been requested a number of times. Rather than make a Table Element, decided to see if the current PySimpleGUI is capable of making nice tables using standard Elements. The answer seems to be yes, it's possible with existing Elements. The key was to enable text justification in the InputText element. By right justifying the text in those Elements, it's possible to create a nice looking table.

Here's an example using a ComboBox and Input Elements.

light table

You'll find the code that generated the table in the file Demo_Table_Simulation.py. It requires the latest PySimpleGUI from GitHub in order to use the justification setting.

This is a "live keyboard" demo. It updates the table values as you are typing.

There are 3 fields at the top of the table. If you enter a value into the 3rd field, the cell that the other 2 cells represents will be changed to that value. Enter 1, 2, 1234 and cell (1,2) will be changed to 1234.

There is a new trick demonstrated in this demo that shows off the power of Python. Rather than pass in a string as the key to the Input Elements, I passed a tuple. Nothing about the key requires it to be a string. The only requirement is that you use the same type to look up the element when you call FindElement or use the key to read the return values.

This is the code that makes the Input Elements:

    for i in range(20):
        inputs = [sg.In('{}{}'.format(i,j), size=(8, 1), pad=(1, 1), justification='right', key=(i,j), do_not_clear=True) for j in range(10)]

See how the key is set to (i,j). This allow me to easily find the Element that is represented by (i,j) later. What to access the cell at (0,0)? This you would make this call:
form.FindElement((0,0))

Hopefully this is enough capability for the folks that need tables in their forms/window.

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 7, 2018

Three Point Oh!

So maybe I kinda screwed up the numbering when the last one became 2.30. I didn't think about it looking like 2.3 also. Doh!

There have been a lot of changes lately so perhaps it's time for a major bump.

It's a clean slate

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 8, 2018

keep_on_top = True

What might this setting do in a call to FlexForm? If you guessed create a window that's ways on top you're right.

This one little flag enables cool floating toolbars that stay on top of all of your other windows. I'll admit a large portion of this project is for selfish purposes, that I have a platform to develop tools on top of.

Now I've got this nifty toolbar on the top part of my screen, always ready to launch or do something.

floating launcher

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 8, 2018

3.0.2 release today to turn off the grab_anywhere feature for non-blocking forms. tkinter is printing out a warning/error message when the form is closed using a button. Doesn't appear to have any effect on the overall functioning, but it's distressing to see. Better to disable this feature for now.

Plan is to add back an override mechanism should a user want it.

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 8, 2018

RELEASED 3.0.2

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 8, 2018

Floating Toolbar - New demo program

This is an always-on-top, compact floating toolbar. They are super-handy to leave running. Something satisfying about writing code that then gets used often, especially if they make you much more efficient.

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 9, 2018

Async Forms

Updated the Readme / primary doc to discuss the use of non-block forms.

As explained in the documentation there are a number of techniques to move away from async forms including using the change_submits = True parameter for elements and return_keyboard_events = True

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 9, 2018

Floating Desktop Widgets

I've discovered that in about 30 lines of code you can create a floating desktop widget.

snap0276

If you click the pause button, it switches to Run.

snap0275

This "Widget" is always on top of the other windows.

Looking for a way of launching these in a way that have no taskbar icons. If launched from PyCharm it behaves this way. If launched from a Toolbar, the toolbar's window is attached to the timer. Close it and the timer closes.

This demo is the first time I've ever combined a ReadNonBlocking with a Read in the same form. The reason for using it in this program is that while the timer is paused, there' s nothing happening so why have the program running the loop when it can wait for the user to do something like click a button. When the button is clicked we return from the Read call.

Thank you to jfong for sending an interesting version of this program. His ideas have rolled into a into the project code many times.

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 10, 2018

Menus are done

The last of the big features, Menus, was just released to GitHub. With it comes the ability to get the look and feel of a windows program. I don't know if the architecture will lend itself to being used this way or not, but it did seem like a useful feature to add..

snap0204

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 10, 2018

3.7 Support

Thanks to @mrstephenneal we can now say that PySimpleGUI works on Python 3.7. There was a button issue causing trouble. Looks like it's fixed now so I think 3.7 is now safe to with PSG.

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 10, 2018

Release 3.01.00

Menus! (and a Listbox.Update bug) are the big features.

Since the Menu code is somewhat isolated, and I want to get some users on it, decided to go ahead and push it all out there in 3.01.00

I didn't mention this in the readme section on menus, but by default (you can't currently turn it off) menus are detachable. If you double-click the dashed line then you get a floating version of that menu. Should make for some pretty interesting user interfaces?

tear off

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 10, 2018

3.1.1

There have been enough bug fixes to trigger another PyPI release. People have been doing more and more with the Update method. These fixes were mostly in those methods.

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 11, 2018

Update methods updated

Added the ability to enable / disable all input elements.
Set parameter disable=True to disable, disable=False to enable, disable=None to leave it alone

A number of Demo programs also refreshed.

Expect a PyPI release soon.

Note that some Update method changes also changed parameter names from new_value to value, new_values to values. Some were different than others. Removed new_ so they all match now. Sorry to those living on the bleeding edge!

Here's a before/after. Elements towards the bottom of the window were disabled.

Yes, even buttons can be disabled now. No more needing to gray out your own buttons!

enabled
disabled

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 11, 2018

3.1.2

Big change this time around is the ability to disable widgets. All input widgets have an Update method that has the parameter disabled that you set to True if you want to disable it.

A few critical bugs in there too which pushed up the release to today.

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 12, 2018

Resizable Windows, Font settings for input text elements, beginnings of Treeview Element

You can stretch windows bigger now and some of the elements will resize with the window. **

The Input Text Elements did not have a functioning Font setting. Doh! Don't know how that got missed.

The very beginnings of the Treeview element are in there.

Hopefully nothing was broke. Any time I make changes to the core widget packing I get nervous!

** Had to turn off some of the Resizable windows features....Buttons and other elements were moving / expanding in forms that I didn't want the to expand. The change fucked up too many elements to leave on for now.

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 12, 2018

Two new Demo programs - CPU Desktop Widget, Spinner Compound Element

Added another Desktop Widget to the demos. This one shows the CPU utilization.

cpu widget

The spinner allows you to change how often it's refreshed

The Spinner Compound Element was done in response from a user wanting to see a different kind of spinner. This one has larger buttons and is laid out horizontally.

spinner compound

The point of this demo is that it's possible to put together multiple Elements into a higher level element. There aren't many of these I can think of at the moment, but given how many user questions are asked, something else is bound to be asked for.

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 13, 2018

Table Element, Complete rework of Popups, Death of MsgBox

You can blame the Popup changes on this issue:
#204

All of the Popups were rewritten to use a long list of customization parameters. The base Popup function remained more or less the same.

Decided while I was going all the Popup work that it's time to completely remove MsgBox. Sorry all you early adopters. You'll need to do a bulk rename and then you'll be fine.

Table Elements

Finally have something to show in the form of tables. The element name is Table. While the tkinter Treeview widget was used, many of the parameters were not exposed. If they were, the caller could really mess things up. Better to present a nice "Table-friendly'" interface than something specific to tkinter. After all, the plan is to expand PySimpleGUI to use other GUI frameworks.

A Demo program is in the works.

It's possible to add scrollbars to the Table element by simply placing it into a Column element.

There's still work to do and a good number of bugs, but I encourage you to give it a try.

scrolled table

If you do not put the Table Element inside of a Column, then you can still view and scroll the table, it just will not have scrollbars.

There is a problem currently with keyboard input when placed into a Column. The keyboard keys work fine when NOT inside of the Column but stop working when placed inside a Column Element.

This program will read a CSV file and display it in a window.

import csv
import PySimpleGUI as sg

filename = sg.PopupGetFile('filename to open', no_window=True, file_types=(("CSV Files","*.csv"),))
# --- populate table with file contents --- #
data = []
if filename is not None:
    with open(filename, "r") as infile:
        reader = csv.reader(infile)
        try:
            data = list(reader)  # read everything else into a list of rows
        except:
            sg.PopupError('Error reading file')
            exit(69)

sg.SetOptions(element_padding=(0, 0))

col_layout = [[sg.Table(values=data, headings=[x for x in range(len(data[0]))], max_col_width=8,
                        auto_size_columns=False, justification='right', size=(8, len(data)))]]

layout = [[sg.Column(col_layout, size=(1200,600), scrollable=True)],]

form = sg.FlexForm('Table', grab_anywhere=False)
b, v = form.LayoutAndRead(layout)

It's another bit of PySimpleGUI "challenge code"..... The challenge is to do the same operation in another GUI framework in less lines of code. I would enjoy seeing the tkinter code required to create the window that this 20 line PySimpleGUI program creates. Most of the code deals with reading the CSV file 👍

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 14, 2018

Linux Virtual Environment

I finally installed VirtualBox and am running Ubuntu Linux. I tried to install the Mint distro, but the display was scrambled when it booted.

I was surprised how close the Linux screen shots look to the Windows.

ping graph linux
toolbar linux
all linux
ping linux

Even Pong worked the first time.

I don't believe that Python has been labelled the "go to language" for doing cross-platform GUI work. I guess I never stopped to think about it. I don't recall seeing this kind of thinking in posts or books I've read on Python. Perhaps it's time for that to change?

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 14, 2018

3.2.0

Released a new release to PyPI. Sorry about all these releases, but features continue to pour into the code. I'm finding even the folks that are actively using PySimpleGUI only run the pip installed version rather than the GitHub version. That means if I want runtime on the code, I'm only going to get any is to do a full release.

There were a number of changes that could f-up, so be on the lookout. The biggest addition to 3.2.0 was the Table Element (beta quality at the moment).

If you are running older programs then you may crash due to missing functions, MsgBox and several others. This is because I've moved 100% to Popup calls. It's not like I haven't been warning people so I don't expect complaints.

Some people are calling ReadNonBlocking prior to your Event Loop so that the form gets fully made. This call is needed if you want to perform actions on elements prior to calling Read. For example, if you want your form to be shown with some Elements set in the disabled state (using calls to Update), you will need to make an additional call after your Layout call.

Instead of calling ReadNonBlocking in these situations, you can call Finalize/PreRead/PrepareForUpdate. I have not been able to standardize on a name, so I'm providing multiple. I'm sure a winner will emerge. I've been using Finalize.

The call sequence becomes this:

form.Layout(layout)
form.Finalize()
element.Update(.....)
while True:
     b, v = form.Read()

You'll also find the Finalize call used in the scripts that use the Canvas Element.

See the Readme for more info on what's in the release. Note that the readme has not yet been updated with the Table Element and several other changes. There's only so much I can do.

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 15, 2018

One Line Progress Meters

PySimpleGUI has always had a one-line progress meter called EasyProgressMeter. However, that function has a limitation of only 1 meter being active at a time.

The new way to do Progress Meters is the function OneLineProgesssMeter.

All of the documentation and examples will reflect this new function.

Have to say it's nice to be able to run as many meters as desired without having to worry about more than 1 being on the screen at a time.

I intend to remove EasyProgressMeter within the next 5 or 6 releases to PyPI. I tried to insert a warning in the code, but too much code was shared to fit the message in.

I'm sorry about the change, but really would like to both add this function and rename the capability to something very descriptive. If there is enough revolt over removing EasyProgressMeter, I'll leave it in and simply drop it from all the documentation.

onelineprogressmeters

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 15, 2018

3.3.0

Yea, yea, it seems like only yesterday that version 3.2.0 was released. That's because it WAS only yesterday. I've been busy.

There are 2 changes I wanted out quickly....

  1. The ability to turn off displaying row numbers
  2. The new OneLineProgressMeter function

The Progress Meter feature alone is a great use of PySimpleGUI. A number of users are using it only for this purpose in their programs.

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 16, 2018

Graphing

New demo program - graph ping using canvas.
I'm thinking about creating a Graph Element, something that makes it super easy to users tog create graphs, both line and x,y plot. The demo should how to take a canvas element and graph ping times.

There is another ping-graph demo using Matplotlib. This graph only uses tkinter.

Finally, because the pings take a long time, I moved the ping calls outside of the GUI event loop. Calling ping inside event loop was causing the GUI to respond sluggishly. This is because the ping was taking 1 second which means the gui wasn't being refreshed / wasn't responsive during the second. Now the GUI sleeps for 200 ms while the ping is done by a thread.

This is yet another toe in the water with threading. The problems I saw in the past are no longer there, it would appear.

I also checked in the ping.py file that you need for this demo. It's a pure python implementation of ping and works pretty well, even if slow.

ping graph

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 16, 2018

Progress Meters

Thanks to @JorjMcKie I've learned more about the performance of the EasyProgressMeter and thus probably the OneLineProgressMeter. The more arguments to display the longer it takes.

Was going to document in the Cookbook / Readme that if you have performance concerns, you can call the progress meter less frequently. You don't have to update it 1 count at a time. It could be like this:

for i in range(10000):
    if i % 5 == 0: sg.OneLineProgressMeter('My 1-line progress meter', i+1, 10000, 'single')

This meter is only called every 5 times through the loop. It finished quite a bit quicker than the test updating the meter every single time.

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 16, 2018

PySimpleGUI programs as an EXE file!

The biggest thing to hit PySimpleGUI since Colors.... the ability to run programs written for PySimpleGUI as an exe file. ALL credit goes to @JorjMcKie for this.

There is no need to distribute Python with your programs. It's all included in the exe and folder of supporting files.

From what I understand of nuitka, this code is compiled C++ code, not python code. The performance is thus potentially better! It's the best of both worlds.

Working to get the process documented. It's tricky and required a special script. Stay tuned....

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 16, 2018

Graph Element

This one is pretty exciting as it does something new on the screen. The Graph Element allows you to easily create a canvas and draw on it using your own coordinate system. You don't need to do conversions from your graph coordinates to the tkinter canvas graph coordinates.

The Demo program for it is a good example. It displays a pint graph. The graph we're creating is a line graph what we would like to to from 0,0 in the bottom left to 100, 500 in the upper right. This will give us 100 data points along the x axis and up to 500 ms on the y axis.

After creating the Graph Element, we can do 3 operations on it:

  1. Draw Line
  2. Draw Point
    3 Erase

The draw line draws a line from 1 point to another. The points are specified using your graph coordinates, not the tkinter canvas coordinates.

snap0282

I know I have a LOT of documentation to do.

In the meantime, try using Control+P if you're using PyCharm. Press Control+P while you are typing in the parameters and you'll see a popup showing you what the legal parameters are. This feature is almost necessary when using PySimpleGUI because functions have SO many optional parameters.

snap0283

I hope to see some cool creations using the capability. I'm starting to see more and more projects pop up on GitHub that use PySimpleGUI! Keep those examples coming! And keep the requests for new features coming too. They have made this such a better package because of your help.

Sample code:

This is your layout:

    layout = [  [sg.T('Ping times to Google.com', font='Any 18')],
               [sg.Graph((300,300), (0,0), (100,500),background_color='white', key='graph')],
               [sg.Quit()]]

    form = sg.FlexForm('Canvas test', grab_anywhere=True)
    form.Layout(layout)

To draw a line, call DrawLine:

form.FindElement('graph').DrawLine(from_point, to_point)

@MikeTheWatchGuy
Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 17, 2018

Movable Graph Element

Made the Graph Element "movable". This means the graph can be shifted when it reaches the "End".

Here's a 1,000 data-point ping graph or 16 minutes woth of pining

scrollingping

@PySimpleGUI PySimpleGUI reopened this Dec 7, 2021
@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Dec 7, 2021

Let's keep the "Announcements Issue" open so that it remains visible to visitors to the project....

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Dec 16, 2021

Wikipedia-Style Banner in the Documentation

I'm at a place in the PySimpleGUI project that I never dreamed I would be at, but sometimes the paths we choose don't lead to where we thought they would.

image

Over the past 88 days, I've watched 5,400 companies and people from 291 universities using PySimpleGUI, a fraction of the actual number of users over that period. The number of users is growing at a rate I never thought it would ever hit despite not promoting the project any longer.

As I see panels popping up at conferences about the "Sustainability of Open Source" I can offer a fantastic case study that even with an incredibly "successful" project, it's not possible for an individual to survive with this model.

The FSF

“free software” is a matter of liberty, not price.

mantra is a myth. "If it can be used for free, it will be" is the more accurate assessment based on the evidence I've seen over the past several years.

These 291 Universities have student users that I'm sure have purchased video games in the past year or faculty members that can afford to toss the project $5 a month. But, they haven't.

I hope the project is ultimately kept open, but have been preparing myself for its close. A number of friends have urged me to try the Wikipedia banner so that's what I'm giving a try. Commercialization has been on the table for a while and I've fought going down that road. It may be the only viable route for the project to survive. The coming weeks and months will determine the next steps.

🙏 I can't express the thanks I have to SO many of you using words. Showing the gratification I have and sharing in the happiness I have for all of you is something I strive to do daily. I'm fortunate beyond my dreams, but I have the reality of needing to provide food and shelter for myself, and that, I cannot do at the moment using PySimpleGUI.

Aalto University
Aalto University Student Union
Adelphi University
Alabama A&M University
Aoyama Gakuin University
Arizona Tri University Network
Auburn University
Auckland University of Technology
Baekseok University
Bangladesh University of Engineering and Technolog
Baylor University
BelWue University Network
Belmont University
Binghamton University
Bogazici University
Boise State University
Brigham Young University
Brigham Young University - Idaho
Brigham Young University Hawaii
Brno University of Technology
Bucknell University
California State University at Fresno
Carnegie Mellon University
Case Western Reserve University
Catholic University of DAEGU
Central Methodist University
Chalmers University of Technology
Chiang Mai University
Chubu University
Chulalongkorn University
Chung-Ang University
City University of Hong Kong
City University of New York
Clemson University
Colorado State University
Columbia University
Cornell University
Curtin University
Daegu University
Dalhousie University
Dong-eui University
Dongseo University
Doshisha University
Drexel University
Eastern Kentucky University
European University at Saint Petersburg
Florida State University
George Mason University
Georgetown University
Gifu University
Gonzaga University
Hanbat National University
Hanyang University
Harvard University
Hebrew University Wireless AP nets
Hong Kong University of Science and Technology
ITMO University
Ihsan Dogramaci Bilkent University
Indiana University
Iowa State University
Iqra University
Iran University Of Science and Technology
Israel InterUniversity Computation Center
James Cook University
Janet University Network
Johns Hopkins University Applied Physics Laborator
KOGAKUIN University
Kagawa University
Kanazawa University
Kansas State University
Keio University
Kennesaw State University
Kielce University of Technology
Korea Aerospace University
Korea University
Kum oh National University of Technology KNUT
Kuwait University
Kyiv National Taras Shevchenko University
Kyoto Sangyo University
Kyoto University
Kyushu University
LeTourneau University
Liberty University
Loyola Marymount University
Loyola University Chicago
Lund University
Lviv Polytechnic National University
Maria Curie-Sklodowska University
Marshall University
Massey University
McGill University
McMaster University
Meiji University
Memorial University of Newfoundland
Michigan Technological University
Ministry of University Affairs
Missouri University of Science and Technology
Monash University Sunway Campus Malaysia
Montana State University
Moscow State Technical University named NE Bouwman
Murray State University
Nanyang Technological University
National Central University
National Cheng Kung University
National Chiao Tung University
National Sun Yat-sen University
National Taiwan Normal University
National Taiwan University
National Technical University of Athens
National Tsing-Hua University
National University Corporation ,Ehime University
National University Corporation Shizuoka Universit
National University of Singapore
New York University
Nicolaus Copernicus University in Torun
Nihon University
North Carolina State University
Northeastern University
Northwestern University
Ohio State University
Ohio University
Opole University
Osaka University
Oxford University
Perm National Research Polytechnic University
Plekhanov Russian University of Economics
Princeton University
Pukyong National University
Purdue University
Pusan National University
RWTH Aachen University
Rangsit University
Rice University
Ritsumeikan University
Rowan University
Rutgers University
Sacred Heart University
Saginaw Valley State University
Saint John's University - College of Saint Benedic
Saint Petersburg State University
Samara National Research University
Saratov State Tehnical University
Seoul National University
Sharif University Of Technology
Siberian Federal University
Silesian University of Technology, Computer Centre
Simon Fraser University
Soon Chun Hyang University
South Africa University Network
Southern Illinois University at Edwardsville
Stanford University
State University of New York at Buffalo
State University of New York, Health Science Cente
Suranaree University of Technology
Swedish University Network
Swinburne University of Technology
Synergy University
TUTNET TUT Autonomous System Tampere University of
Takushoku University
Technical University of Gdansk, Academic Computer
Technical University of Koszalin
Technical University of Lodz Computer Centre
Technical University of Sofia
Tehran University of Medical Science
Telkom University
Texas A&M University
Texas Tech University
The Chinese University of Hong Kong
The Pennsylvania State University
The Rockefeller University
The Singapore University of Technology and Design
The University of Adelaide
The University of Alabama
The University of Hong Kong
The University of Manchester
The University of Memphis
The University of Otago
The University of Tokyo
The University of Western Ontario
The-University-Of-Cape-Coast
Tokyo University of Science
Tomsk State University
Towson State University
Toyo University
Tufts University
Tula State University
Umea University
University College Dublin
University Linz
University Malaysia Pahang
University Of Incheon
University Of Ioannina
University Of South Florida
University Public Corporation Osaka
University System of New Hampshire
University at Albany, State University of New York
University of Advancing Technology
University of Alabama in Huntsville
University of Arizona
University of Bristol
University of British Columbia
University of Calgary
University of California San Francisco
University of California at Berkeley
University of California at Davis
University of California, Irvine
University of California, Los Angeles
University of California, Merced
University of California, San Diego
University of California, Santa Barbara
University of California, Santa Cruz
University of Cambridge
University of Canterbury
University of Central Florida
University of Chicago
University of Cincinnati
University of Colorado Denver
University of Colorado at Boulder
University of Connecticut
University of Delaware
University of Edinburgh
University of Florida
University of Georgia
University of Glasgow
University of Illinois
University of Illinois at Chicago
University of Illinois at Springfield
University of Innsbruck
University of Kentucky
University of Lancaster
University of Latvia
University of Lethbridge
University of Liverpool
University of Louisiana at Lafayette
University of Maine System
University of Maryland
University of Maryland Baltimore County (UMBC)
University of Massachusetts - Lowell
University of Massachusetts Dartmouth
University of Michigan
University of Minnesota
University of Montana
University of Nebraska-Lincoln
University of New Mexico Health Sciences Center
University of New South Wales
University of North Carolina at Charlotte
University of North Carolina at Greensboro
University of North Texas
University of Oregon
University of Ottawa
University of Pennsylvania
University of Pittsburgh
University of Queensland
University of Rochester
University of Saskatchewan
University of Sheffield
University of South Carolina
University of Southern California
University of St. Thomas
University of Sydney
University of Szeged
University of Tennessee
University of Texas Rio Grande Valley
University of Texas at Arlington
University of Texas at Austin
University of Texas at San Antonio
University of Toledo
University of Toronto
University of Tsukuba
University of Utah
University of Vermont
University of Victoria
University of Virginia
University of Washington
University of Waterloo
University of Western Australia
University of Wisconsin Madison
University of Wisconsin System
University of the Ryukyus
Utah State University
Vanderbilt University Medical Center
Victoria University of Wellington
Virginia Commonwealth University
Wakayama University
Washington University
West Chester University of Pennsylvania
Western Kentucky University
Yale University
Yamagata University
Yeltsin UrFU, Ural Federal University
York University

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Dec 20, 2021

Thank you everyone!!

The outpouring of support and words of encouragement have been amazing over the past several days. They're arriving at the perfect time. I've been working so hard to get this Udemy course done by Christmas and your messages and donations are making the long hours shorter.

There have been so many unusual things about this project... it's the gratitude and kindness that have been the most shocking part. So many times users have said "thank you" when opening a GitHub issue.... or thanking Jason for his help. The emails I receive are overwhelming at times. It's hard to describe the soaring feeling of hearing that I've made a positive difference in someone's life.

I'm so very very fortunate to have the kind of users that we have. I look around the internet and I don't see many other projects that are so lucky. Even on YouTube users leave kind comments, not the ugly ones that so often appear online.

I'm not trying to get rich from this project. I'm simply wanting to be able to survive doing it. So many of you are stepping up to help make that possible. I wanted to take a moment and say how much I value, no, cherish, these messages and how impactful they are to me and the rest of the team.

OK, I gotta get back to working! I want to announce this course as done by Christmas!

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Dec 23, 2021

Udemy ALMOST There.... WATCH for more later today!

I've finally completed the Udemy course!

There are 61 Lectures in the course totaling 11 hours 30 minutes.

I'll post a message about it and a coupon too!


THANK YOU for the support!

The support so many of you are sending along with the course may rescue this project! I'm so excited that it may make it yet!!

I've never seen a more grateful group of people for any project I've worked on. It's so touching to see that there are many grateful and positive people all over the world. I know how massively fortunate I am to be surrounded by thankful people. What a warm and wonderful holiday gift.

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Dec 23, 2021

Udemy tomorrow maybe!

Hoping for a Christmas miracle and will be able to post a link tomorrow. The course almost made it through the review process. Only a small change was needed which means it could happen pretty quickly.

Again thank you to everyone for the support. The kindness, gratitude, show of support that so many are expressing has been an incredible experience. Heartwarming words. Wishing for happiness and peace for everyone 🙏

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Dec 24, 2021

Udemy Course is now open and available!

This is a coupon for 50% off:
https://www.udemy.com/course/pysimplegui/?couponCode=2E43BB0C9E0997247E30

The normal link for the course is
www.udemy.com/PySimpleGUI

Thank you for everyone's patience during the past year. The first recording was completed on Dec 26th 2020. It's been a full year (minus 2 days) in the making.

It wouldn't have been possible to do this without the help of Christian, Tanay, and Jason. 🙏 I'm really fortunate to have their help.

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Dec 25, 2021

The Treasure in Programming

image

So much about programming is discussed that falls in the realm of "science" or technology. Very rarely are the emotions and softer parts of programming discussed.

As I read the messages that have been pouring in... messages of gratitude & joy... I have been pondering what about all this that makes me feel the way that I do... the joyfulness of working on this project. Why am I rewarded with these feelings?

I don't know why this diagram popped into my head this morning, but it did. Not sure what to call the red-shaded region, so I've named it The Treasure since it does feel valuable to me.

It's not about skill

Notice in the diagram there is no mention of technical skill, experience, or investment of time. Nothing about doing things right or wrong.

Each category can be defined uniquely by you. That's the secret magic behind this. You can set it up so that this treasure is not only achievable but happens frequently.

Beauty

Beauty can be found in code itself. It can be in the user interface created. There is beautify in witnessing someone be successful. It's everywhere but sometimes has to be searched for. It's rarely far, but can be hidden.

Joy

Joy is for me a short-term experience and one that I'm highly aware of at the time. It can come from seeing something work for the first time. It often arrives quickly, sometimes unexpectedly. "OH! It ran!?"

Satisfaction

This is the deeper, long-lasting part of "The Treasure". It's the part that sticks around.

I truly do treasure this experience that you all are participating in. I'm fortunate to hear from so many grateful people. There is beauty I see daily. I get to share in your happiness, so thank you all for sharing and coming along for this journey of fun and discovery.

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Dec 26, 2021

The Messages

I read every paypal message, every email, every buy me a coffee comment...

It's been SO helpful. They got me through the difficult part of getting the Udemy course done and they're lifting my spirits considerably.

Your donations are helping and will help in the future! Those that are sending small amounts with an apology or explanation why it's not more need not worry about the size. They all add up. Every bit is helpful. You don't need to apologize, but I don't mind at all reading that you're being so incredibly generous by supporting the project despite not having a lot of wealth to draw from. They're touching stories.

The Banner

I will be changing the banner early in January. Like Wikipedia's banner, it wasn't meant to be something that remains up for forever. I genuinely wasn't sure when I posted it if the project was going to get financial support as a result of it. It was as much a "notice for users to prepare their projects for the impact of the project closing" as it was a "plea for help."

I truly did not expect the response it generated. It's been yet another incredible experience that this project has given me. Rather than being upset and depressed about the future of PySimpleGUI, I'm again excited and much more hopeful.

What's with the strange emotional posts like "The Treasure in Programming" above?

It's a counter-balance. There is so much material posted, written, published about disciplined programming. Paradigms, Pythonic, extensibility, maintainability, refactoring, building-for-the-future, the one right way of writing a piece of code (see Zen of Python).

Coming back to programming after being away from hands-on development has been somewhat of a shock. Coding standards, solid best practices, testability, maintainability were certainly serious topics throughout my career, but it feels extreme to me today. There's a level of seriousness and an almost militant tone that I've seen, even for the beginner programmer that doesn't want to pursue programming as a career.

All this touchy-feely-emotional, fun as a goal part of PySimpleGUI is my attempt to shine a light on the other aspect of programming than the serious, approaching robotic way programming is taught.... the fun part... and that the fun part is a very very important part.

Passion & Ignorance

The "fun" can sometimes grow until it becomes "passion."

I've said here dozens of times that I enjoy browsing GitHub repos and seeing the work of beginners.

The reasons are:

  • often beginners exhibit passion. They're downright ecstatic at the simple things... at discovering programming. They're passionate about learning & creating.
  • they don't know "the right way" (yet)

Ignorance is a good thing sometimes. I don't mean stupidity... I mean uninformed. Not exposed to a deeper education. What I am looking for is someone that's "thinking outside the box", and, if you don't know any better, if you're ignorant on a topic, you don't even know a box exists. You're free to explore, experiment, and innovate.

I love quotes and this one from Picasso (one of those "love the art, hate the artist" painters) I think embodies what I'm trying to explain:

It took me four years to paint like Raphael, but a lifetime to paint like a child.
-- Pablo Picasso

It's this child-like passion, innocence, lack of knowing where the boundaries of "correct" are that I seek both personally and when looking through projects.

PySimpleGUI was born from my ignorance of how GUIs "should work". I avoided them my entire career because of the pages of code involved. I was not only a complete beginner in Python but GUIs too when I wrote PySimpleGUI. That ignorance led to a new approach.

Thank you for the Inspiration

PySimpleGUI users inspire me! I think that's what I'm also trying to say. You do it in your words, your code, and sharing with others what you make. I don't recall seeing any GitHub repo where a new programmer had the courage to share their creation and was then criticized in their Issues. Trust me.... you inspire when you share even the most simple of creations.

Parting thought.... Screenshots in your readme!!

A YouTube comment left earlier today reminded me of this trick....

This video teaches how to use GitHub Issues to store images:

https://youtu.be/C4PVKW756fo

Be sure to include a screenshot of your GUI in your readme! You've done something highly unusual in the Python world... you created a GUI for your application. That means you can share a picture of it... humans pictures! OK, maybe it's for my own guilty pleasure of seeing all these wonderful creations that I see posted, but I'm sure others enjoy seeing your work too!

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Dec 27, 2021

Taking Some Time Off

Udemy is done.... help is coming in to rescue the project... things feel a little more stable.

I need to recharge my batteries for a tiny stretch as well as tend to life's mundane tasks that are required to simply exist today.

To do this, I need to unplug, turn off, tune out, and take a break. It'll be good for everyone.

The longest I see being away is through the end of the year, which is in 5 days.

I again thank all of you for making this project one of the most incredible experiences of my life. It's been one of the most challenging too, but maybe the two are required to be present. Your kindness and generosity have been wonderfully overwhelming.

I hope that others helping the project take a break as well. Everyone deserves a break, a period of reflection, rejuvenation, renewal. For me, much of my recharging comes from the fuel provided by all of you. Your kind words echo in my head frequently. It's a very positive message to replay.

See you soon!

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Jan 3, 2022

2022 - Off to a great start!

Down came the "banner of desperation" today.

The response has been an overwhelming experience. The words of encouragement helped immensely! The donations and sponsorship paid the bills and combined with the Udemy course are going to perhaps keep this project running. I'm very hopeful feeling about the future despite not being able to predict it.

Every Bit Helps

A number of users donated and included a note that was apologetic.... it was all they could afford. A $4 donation pays for the GitHub account for the month. There is nothing to be embarrassed about nor apologize for when you've donated and helped in any manner.

I don't want to discourage telling me your stories, if your donation is difficult to make, or any other message you care to send. They're all read, re-read, written down, shared with team members. They're cherished, appreciated and really demonstrated what a remarkable group of users

Sponsoring Other Developers

Now that the PySimpleGUI project has sponsors and was able to pay the bills this past month, I felt like I can sponsor other developers that I look up to or inspire me. I'm thrilled to be able to give to other people also writing software. We're all doing the best we can with what we've got and it's really great to be able to help these other developers.

"Pledge Drive"?

Raising awareness of the funding problem certainly brought out a big response just as it does for Wikipedia. I'm wondering if this may be the way PySimpleGUI can continue to function in the long run. I don't want to keep focusing the financial piece all the time, so maybe a periodic drive would be a way to. The Udemy course may be the recurring income that can keep these kinds of events minimal.

75/25 Time

I'm splitting my time up between being back here in the GitHub Issues in an active way and releasing software for 3/4 the time. The other 25% is spent in adding to the Udemy course materials to help make it better. With Udemy being the only income source I would like the course to be as good as I can make it. Udemy makes it possible for code quizzes to be a part of the course but they don't support GUIs so I'm having to be a bit creative for that part.

Mike Driscoll's Excel Book

In late November Mike Driscoll released his latest Python book titled:

Automating Excel with Python: Processing Spreadsheets with OpenPyXL and Python

AutomatingExcel

You'll find it on Gumroad:
https://driscollis.gumroad.com/l/openpyxl/tenoff

And on Amazon:
https://read.amazon.com/kp/embed?asin=B09MG2SC9V&preview=newtab&linkCode=kpe&ref_=cm_sw_r_kb_dp_RWRYZG79F0NRSYJJDHBE

You can always find out the latest happenings with Mike's books on his blog located at:
https://www.blog.pythonlibrary.org/

I got my copy via Kickstarter and it's an excellent book.

Education

Speaking of all this education....

I wanted to follow up on a post just before the holidays and make sure the right message was being sent. I wrote about "ignorance" and how it can be an advantage.

The message was not that being ignorant is something to strive for or that not getting educated is a good thing. The point was that if you're still getting started and feel frustrated that you haven't learned as much as you would like, that a slightly different point of view may help. Your lack of knowledge doesn't have to be a negative thing and at times can be an advantage.

Hopeful About 2022

The outpouring of gratitude I've seen by PySimpleGUI users over the past month has had a big and positive impact. Thank you all so much for the help!

I hope all of you have a fantastic 2022 and that the large number of people that struggled last year won't so much this year... that it's a better year for everyone. 🙏

image

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Jan 3, 2022

Pirated Course

A kind user just informed me of a copy of the PySimpleGUI Udemy course being offered for sale elsewhere. There's only 1 place at the moment to get the Udemy course, and that's on Udemy.

The New Banner

This is what the top of the documentation (http://www.PySimpleGUI.org) now displays instead of the "help" banner. It's much more pleasant looking.

image

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Jan 5, 2022

Working on 4.56.0 release...

The near-term work is to get the changes that have been piling up on GitHub released to PyPI. But first I want to address the 8.6.12 tooltip problem so that fix is in there. A scan through the issues may turn up other critical problems, but I also don't want to take too many changes. The goal is to get these changes that have been on GitHub for a while out to the wider user base.

It's great to be back to the day-to-day project work.

The background work of adding exercises to the course has been also happening this week.

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Jan 5, 2022

4.56.0 PySimpleGUI 5-Jan-2022

The "It's been a minute" & "Welcome to 2022!" release

  • Addition of stdin parm to execute_command_subprocess. This is to fix problem when pyinstaller is used to make an EXE from a psg program that calls this function
  • Changed getargspec call in the SDK Reference window to getfullargspec. In 3.11 getargspec is no longer supported and thus crashes
  • Added try to SDK Reference event loop to catch any additional problems that may pop up in 3.11
  • Added Window.move_to_center moves a window to the center of the screen. Good for when your window changes size or you want to recenter it
  • Disable debugger when installing from github
  • Better error reporting when a problem with the layout detected
  • Removed import of site and now get the information from os.path.dirname(sys.executable). I like simpler!
  • Combo added parameters to control the colors on the button used to display the items. Parms are button_background_color and button_arrow_color
    • Default values continue to be the same the theme's button color if nothing is set.
  • Fixed missing docstring item for Table value so that the new documentation will be accurate
  • (Maybe temporarily) added print to the Text element. Was an easy addition, but is limited in how colors are controlled, scrolling, etc. May be very short-lived addition.
  • New Table Element parameter right_click_selects. Default is False. If True, then will select a row using the right mouse button, but only if
    • zero or one rows are selected. If multiple rows are already selected, then the right click will not change the selection. This feature enables
    • a right-click-menu to be combined with table selection for features such as "delete row" using a right click menu.
  • Fixed bug in Column element was incorrectly checking background color for None or COLOR_SYSTEM_DEFAULT
  • Changed docstring for Table.get_last_clicked_postition to indicate what's returned now. Was not useful for tkinter port until recently when cell clicks added.
  • Better auto-sizing of Columns for Tables.
    • Better sizing of the row number column using the font for the header in the calculation
    • Use the column heading font to help determine if the header will be what determines the width instead of the data in the column
  • Don't print the error message about wm_overrideredirect while hiding the master root if running on a Mac.
  • Fix for Tree Element not setting the row height if none is specified. Needed to set to value based on the font used.
  • Tree Element
    • Always left justify the first column. This is how it's always worked. tkinter 8.6.12 changed the behavior of the first col. This changes it back
    • Better auto-size column. Uses the data as well as the Column header to determine size of column
  • Table Element fix case when tables have too many headers, thus not matching the data columns
  • Tree element addition of a heading for the Column 0 (the main column shown in the Tree). Default is '' which is what's shown today.
  • Graph Element Experimental addition of parm motion_events If True then mouse motion over the Graph returns event of key '+MOVE' or (key, '+MOVE')
  • ButtonMenu Element
    • New init parm image_source Use instead of the filename and data parms. This parm is a unified one and is how several other elements work now too.
    • New update parms image_source, image_size, image_subsample enables the initial image to be changed to a new one
  • Fix in sdk_help crashed if asked for summary view of Titlebar or MenubarCustom because they're not classes
  • Fix in open github issue the python experience and overall experience values were swapped.
  • UserSettings delete_entry will show popup error now with traceback like almost all PySimpleGUI errors (can be silenced)
  • TTK Button wraplen fix, height padding fix? (thank you Jason for another fix!)
  • Button fix for wraplen on non-TTK buttons.
  • Layout reuse error message
  • Fix for set_options checking for "not None" instead of "True" for the dpi_awareness setting. Note that once turned on, there is no option to turn off.
  • Docstring changes for all Element.update methods to indicate that the change will not be visible until Window.refresh or Window.read is called
  • Enabled the Text class methods that measure strings and characters to be called prior to any windows being created. Method list:
    • string_width_in_pixels, char_height_in_pixels, char_width_in_pixels
    • Replaced the error messages that were being printed with a poper error popup
  • Removed destruction of hidden master root from popup_get_file and popup_get_folder

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Jan 8, 2022

Python f-string / Formatting Cheat Sheets

f-strings are one of the most brilliant programming designs I've ever seen. They were definitely one of those "finally done right!" kinds of features. Being able to both write the text to be printed with the variables and expressions in-line with them has been an elusive problem that I had never felt happy about until I saw f-strings.

The wonderful things about f-strings are the options they provide for formatting, in particular the date/time formatting. For the past few years, I've needed to search every time I take advantage of f-string formatting. I've never saved a link that I was happy with. Until this week...

image

The wikipython.com site is filled with incredible cheat-sheet formatted Python goodness. I've mentioned them here before. These new ones that cover formatting are now built into my personal tools. I'm a button press away from this information and it saves a lot of time.

This link is the webpage view:
https://www.wikipython.com/big-daddys-toolboxes/output-toolbox-in-progress/

If you want to download a high resolution 600 dpi version, you can get it from John's GitHub page:
https://github.com/GitHubJohn2/TB3-Format-Options/blob/master/Format%202022b%20600dpi.pdf

The Toolbox Starting Point

If you're just starting with Python or looking for a place to start looking through the information available, the Toolbox page is a good way to start:

https://www.wikipython.com/big-daddys-toolboxes/

He's got numerous reference pages including this subset - The Raspberry Pi GPIO information, many pages of tkinter material (SIXTEEN pages of densely packed, carefully formatted reference info), Data-On-Disk (Pathlib, CSV, JSON, pickle, etc)

Opening Files Using PySimpleGUI - Tip of the day....

These reference pages are so handy that I've added them to my desktop launcher.

If you want to open a file using the standard program associated with that file then you only need to call execute_command_subprocess. The Operating System will launch the appropriate program that's associated with the filetype.

For example, to open the formatting PDF I call the PySimpleGUI function execute_command_subprocess and pass in the file to open. In this case:

sg.execute_command_subprocess(r'C:\Python\PDFs\PythonWikiFormatting.pdf')

If you have extracted the images from the PDF and want to open the individual page, then instead of passing in the PDF filename, you would pass in the image filename:

sg.execute_command_subprocess(r'C:\Python\PDFs\PythonWikiFormattingPage1.jpg')

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Jan 13, 2022

Course Piracy, Security, Malware

The proliferation of pirated PySimpleGUI Udemy course videos continues to spread.

My concern is less of piracy and one of security. Of course, piracy financially impacts all authors, but the person that has the most potential exposure is the user of these pirated materials.

If you see sites like itlearndl.com offering the "Python GUIs – The Official PySimpleGUI Course" available for download, please understand that this is not a site affiliated with the PySimpleGUI project and that you may be exposed to malware as a result of downloading materials.

This kind of thing will happen for any course, book, ebook, etc, so it's not surprising and I have no plans on constantly drawing attention to these sites. But since the course was released only 19 days ago, it seems reasonable to mention words of caution a couple of times.


Cooking up some recipes

I'm working on documentation and more materials for the Udemy course as mentioned earlier. The Push and VPush elements are the focus for the one I'm working today for the Cookbook.


I hope everyone is having an awesome 2022 so far. I love what you're making and sharing! It's truly exciting to see so many creative projects.

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Jan 14, 2022

Hot Push, VPush Recipe in the Cookbook!

Added a lengthy Recipe to the Cookbook that shows using the Push and VPush elements so you can see an easier way to find justification and alignments.

You'll find the new Recipe here:

https://pysimplegui.readthedocs.io/en/latest/cookbook/#recipe-element-justification-and-alignment

Here's a small sample of one of the example pieces of code.

image

Multiple Monitors

Also added the code that was released as a Demo Program some time ago. I use this tool to help determine the (x,y) location tkinter uses. Really handy if you want to locate something at a specific spot on the screen.
https://pysimplegui.readthedocs.io/en/latest/cookbook/#recipe-positioning-windows-on-a-multi-monitor-setup-tkinter-version-of-pysimplegui-only

Demo code is located here:

https://github.com/PySimpleGUI/PySimpleGUI/blob/master/DemoPrograms/Demo_Window_Location_Finder.py

image

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Jan 16, 2022

New Emojis and Demo!

With some luck, this announcement will work correctly...

image

Emoji Toolbar

The PySimpleGUI Emojis have been a nice addition to the overall experience. I use them personally when communicating on all sorts of platforms, not just GitHub.

I just added a new Demo Program that includes these new emojis. I've been using the demo for some time on my computer, but never posted it as an official demo until now. You can use it for your own custom emojis. Instructions are in the demo program on how to go about adding them.

You'll find the Demo Program here:
https://github.com/PySimpleGUI/PySimpleGUI/blob/master/DemoPrograms/Demo_Emoji_Toolbar_PIL.py

It pops up a window at the location of your cursor, you click an emoji, it's placed onto the clipboard, and then the window closes.

image

At this point, you can paste your emoji into whatever program or webpage you want.

I use PySimpleHotkey to control launching the toolbar.

They're integrated into PySimpleGUI on GitHub and will be posted to PyPI in the next release. A huge thank you to @Snaiel (an awesome PySimpleGUI team member) for making these happen. He worked with an artist to get the original set made and we just got this second batch in this week.

Hoping these add to the "Fun" goal of PySimpleGUI.

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Jan 22, 2022

New YouTube Video - The 2022 Update

I added a new YouTube video yesterday that you'll find here:

https://youtu.be/lRuvKfilJnA

The purpose of the video is to inform visitors to the PySimpleGUI YouTube channel that the "PySimpleGUI 2020" videos that are there now represent a snapshot of PySimpleGUI capabilities as of 2020 and that development has continued for the years following those videos.

There have been 3 different YouTube video lessons

  1. Oct 2018 - 5 basic lessons
  2. Nov 2018 - 7 additional lessons to make it a "complete" course
  3. April/May 2020 - "PySimpleGUI 2020"

The new 61 lesson Udemy course is the 4th video course I've recorded for PySimpleGUI and covers the features that were added after May 2020 when the YouTube videos were recorded.

A lot has happened in those couple of years and wanted to have something posted in the channel that reflected this as well as where to get the latest documentation, tools like the Demo Browser, and that the Udemy course is now available.

One of my favorite parts of that video was scrolling through issue 10, the User Screenshots. It's so much fun to see what users are creating. I'm working on a new feature that will make sharing screenshots easier. It's still early in the development process.

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Jan 23, 2022

Spotlighted User @DuesAres...

It's infrequent but I've pointed out interesting projects on occasion. Issue #10 I eagerly read posts right away. Sometimes I look through repos that GitHub reports on the main page:

image

I find myself frequently requesting an upload of a screenshot so visitors can immediately see what they've created. Sorry if you've been a recipient of one of these requests. I don't mean to create more work for you.

image

Of course, users that file issues are of interest. One such user recently was @DeusAres. He envisioned flat, rounded corner buttons that highlighted when they're moused over.

That's exactly what he created.

RoundedButtons

This is a fantastic example of doing whatever is required in order to make a GUI that's attractive and follows a design theme that's different than the default. Beautiful in a non-default way doesn't just happen. Sometimes it takes a little work, but it's possible. Can't help but have respect and admiration for @DeusAresfor putting in the time and effort.

image

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Jan 23, 2022

Beginners, again....

image

I love quotes.

Circling back to a post a while back where I've been fumbling around about being ignorant is sometimes a good thing, and then trying to explain what that meant. This quote are the words I was looking for.

[EDIT] - The image may not come through email.... it reads:

'In the beginner's mind, there are many possibilities, but in the expert's mind there are few.'
-- Shunryu Suzuki

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Jan 24, 2022

New Coupon Code...

Not having created a Udemy course in the past, I didn't know their coupon codes were, well, kinda weird.

Here's a new coupon good for the same discount as the previous. However, unlike the last one that was good for 30 days, this one is only good for 5 days. I'm not able to re-use older codes and they have unusual restrictions on what the amount can be set to. They wanted me to change an additional $39 more if I wanted a coupon good for 30 days like the previous coupon.

The documentation and the PySimpleGUI code have been updated with the new coupon code. I'll keep trying every day to set up a longer-term coupon and see if they end up letting one go through.

THANK YOU Students, Sponsors, Donors!!

I so very very very very very very much appreciate users that are signing up for the course!

image

The Udemy Students, GitHub sponsors, and ButMeACoffee Donors are literally keeping PySimpleGUI alive.... making it possible for me to continue to work on this project by helping to cover the expenses. I'm grateful for your help and fortunate to have such kind users that say encouraging words that keep me motivated to push forward.

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Jan 26, 2022

Readme Screenshots

I've mentioned them here before, but looking back I don't see where I pointed out that there's a Cookbook Recipe describing ways to add screenshots to your readme files in your GitHub repo (or any markdown document).

https://pysimplegui.readthedocs.io/en/latest/cookbook/#recipe-post-your-screen-shots-please

I'm working on a Gallery feature that will hopefully help in numerous ways. More info in the not too distant future.

GIFs

If you want to add a GIF to your readme, then you may be interested in a free tool called ShareX that creates GIFs that are quite compact. I've been amazed at being able to get multiple seconds of a large screen in a few MBs and for smaller moving images they're often in 100's of K.

Take a look... you may like it...

https://getsharex.com/

It's what I use to make all of the GIFs you'll find associated with this project. This one if from the readme:

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Jan 27, 2022

Tip - Getting update Call Signatures

I use PyCharm so this post will be PyCharm specific.... you can likely apply it to your preferred IDE however.

The Problem - Elements are "looked up"

When you want to call the update method for an element, you typically perform a "lookup" of that element and then call update. They are generally of the format:

window[key]

The problem is that the IDE doesn't know exactly which type of element will be returned from the lookup as you're writing your code.

There are 2 ways you can get some help with this.

An example program

import PySimpleGUI as sg

layout = [  [sg.Text('My Window')],
            [sg.Input(key='-IN-')],
            [sg.Text(size=(12,1), key='-OUT-')],
            [sg.Button('Go'), sg.Button('Exit')]  ]

window = sg.Window('Window Title', layout)

while True:
    event, values = window.read()
    print(event, values)
    if event == sg.WIN_CLOSED or event == 'Exit':
        break
    if event == 'Go':
        window['-OUT-'].update(values['-IN-'])    

window.close()

Method 1 - Use a temp variable and a type annotation

I'm replacing this line:

        window['-OUT-'].update(values['-IN-'])    

With 2 lines of code:

    if event == 'Go':
        elem:sg.Text =  window['-OUT-']
        elem.update(values['-IN-'])

You can also use the comment type of type annotation which will enable you to use earlier versions of Python

    if event == 'Go':
        elem =  window['-OUT-']         # type: sg.Text
        elem.update(values['-IN-'])

Method 2 - Type annotation using comment with 1 line of code

    if event == 'Go':
        window['-OUT-'].update(values['-IN-'])      # type: sg.Text.update()

This one is my favorite as it doesn't require an extra variable but I'm still able to get the code completion. The important piece of this technique is that the parameter documentation is not provided for the code portion, it's provided in the comment portion.

Screenshots

In PyCharm, the keystrokes that are helpful for getting the documentation and parameters are:
Control+P - Shows the parameters (press with cursor between the parenthesis of the call)
Control+Q - Shows call reference (press with the cursor on the method being called

Here you can see I've pressed Control P in the comment portion and I'm shown the parameters.

SNAG-1539

And this is the view you get when pressing Control Q. I typically prefer this one.

SNAG-1540

If all else fails, use the documentation

Don't forget that these call signatures can be found in the call reference portion of the documentation
http://Calls.PySimpleGUI.org

We've been looking at the Text element above. If you check the call reference for the Text element, you'll find this nicely formatted list of the parameters:

image

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Jan 27, 2022

Tip - update Call Signatures (Part 2)

If your IDE doesn't support docstrings and you don't have access to the internet to get the online documentation, then you can fall back on the "SDK API Call Reference" window built into PySimpleGUI.

Here is the Call Reference window with the Text.update documentation shown:

image

Note the link at the bottom of the window will take you to the online documentation for the information being shown.

There are 3 ways to get this window

1. Type psghelp from the command line

image

2. Type psgmain from the command line or call sg.main() from your code

This will bring up the PySimpleGUI Test Harness

From here click the "SDK Reference" button

image

image

3. Call sg.main_sdk_help() from your code

The result is the same as if you typed psghelp from the command line.

Summary Mode

If you click the checkbox at the bottom "Summary Only" then you'll get an abbreviated view that makes seeing the init and update parms easy:

image

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Jan 27, 2022

Tip - update Call Signatures (Part 3)

I just released two tools that are used in the Udemy Course.

They weren't meant to be released tools. They were simply teaching aids. But you may find them helpful, so I'm releasing them as Demo Programs.

Demo Browser

I recommend the Demo Browser to interact with the Demo Programs. It's the only way I'm able to keep track of, search, and interact with the now 330 Demo Programs. If you search for SDK (once you have the newest copies of the demos) you'll find the new Demo Programs:

image

Element Init and Update Parameters

One of the tools focuses on the Init and Update parameters for the elements.

Choose the element you wish to view using the Combo box at the top. Sticking with the Text element I've been discussing in the past 2 posts, we can see the init and update parameters are displayed in the window with the pink parameters representing "Common Parameters" (parameters that are commonly found in many of the elements).

image

Function Parameters

The second of these SDK Parameter Viewer demos show the parms for functions found in PySimpleGUI.

image

The default view is only functions that are all lower case. Some functions are used to implement elements such as the Push element. To see these functions, right click and choose: Upper Case Too

image

This will populate the combo with all functions.

image

A word of CAUTION

These were not designed to be released publicly, so you'll find Functions listed that are perhaps not user callable or have been imported from another module like tkinter.

ENJOY!

My hope is that these will maybe save you from looking like this:
image

And maybe instead look like this:
image

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Jan 27, 2022

popup_get_text - Heads-up if using font parameter

Just checked into GitHub a fix for popup_get_text. The font parameter was incorrectly only being applied to the Text portion of the window. All of the other popups apply the font parameter to the entire window.

It's a fix that is not backward compatible visibly and thus the announcement. It's a rare situation. Thank you goes to @resnbl for finding one of the oldest bugs I can recall. Then again, I can't recall much about last week.

image

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Jan 28, 2022

psgtray - Package That Adds System Tray to PySimpleGUI (tkinter)

To say I'm a user of PySimpleGUI is an understatement. I'm hooked. My efficiency as a developer has improved, my overall Windows experience is better. In some ways, it's a selfish project as I'm enjoying the benefits perhaps more than most.

I count 21 PySimpleGUI programs running at the moment. Most of the PySimpleGUI programs that run continuously in the background are "Desktop Widgets" (like Rainmeter). The two highlights on this Taskmanager are "running in the system tray".

image

There are 3 ways of getting a system tray icon to work with PySimpleGUI:

  1. Use PySimpleGUIQt
  2. Use PySimpleGUIWx
  3. Use PySimpleGUI (tkinter) with the package psgtray (the technique I use the most)

The psgtray package has a matching GitHub repo.

I use it at the moment for 2 programs. One is a hotkey manager and the other is "pingmote", a program that enables me to use custom emojis in Discord. HUGE thank you to @dchen327 for writing the initial version pingmote that I modified a bit.

The nice thing about the way psgtray is architected is that it is not written in a polled manner. There is a single window.read() call with no timeout. That means it'll block until something happens. Of course if you do want to poll some resource then you can simply add a timeout to your read call.

If you've got code that runs in the background all the time and want to be able to interact with it without having a window open all the time like a desktop widget, then this may be an excellent design for you. If your code runs in the background and you currently have to kill it with task manager or don't have an easy way of stopping your code, then this may be an excellent solution.

Here are a few screenshots from my version of Pingmote to give you an idea of what you can do.

When I first startup, I show a message:
image

Right-clicking brings up a menu and this is where you could add the ability to exit your background program.
image

The ubiquitous "Edit Me" choice I've added so that I can easily change the program without knowing exactly where the source code is on my system.

Pairing with a GUI.... or not

The beauty of psgtray is that you don't HAVE to have a GUI if you don't need one. You can use it to simply control your background program.

But if you do want a GUI to go with it, that's easy to do too. I've got my Hotkey program setup to operate as a traditional system tray program - double-click shows the GUI window. Closing the GUI window "minimizes to the system tray" instead of closing.

image

I hope you're having as much FUN with PySimpleGUI as I am... it really is fun to get to build my own tools for a change.

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Jan 31, 2022

Demo Program Monday!!

Just finished posting a new pip installable version of all of the demo programs and the Demo Program Browser!

image

What's the big deal, you might ask?

image

Well... it makes installing and using the Demo Programs and the Demo Program Browser much easier.

pip install psgdemos

To get the Demo Browser and the Demo Programs in 1 easy step, you can now install them via pip.... and you can launch the demo browser by simply typing: psgdemos (after you've pip installed)

psgdemos

Version 1.2.1

The "initial version" is 1.2.1. I don't seem to be capable of making a 1.0 version that stays 1.0 for very long. Setuptools forces an ever-increasing version number... and I truly did believe I was "done" at each of the prior versions.

Was Not Heavily Tested

I wasn't planning on making this release today, or any day... it just struck me this morning that it would be a good thing to have, so prior to starting the normal work-day, I snuck this project in.

Documentation Updates Coming

The Cookbook and other documentation that references the Demo Browser will be updated right away to indicate this new and easy way of installing the demos.

Fun!

Hoping this will make your PySimpleGUI experience all the more fun! Gotta keep working on that primary goal.

image

image

@PySimpleGUI
Copy link
Owner

@PySimpleGUI PySimpleGUI commented Feb 1, 2022

psgdemos - Video Soon...

I run the Demo Browser at least 30 times a day, likely more. I have extra keys on my keyboard and one of them launches the Demo Browser. It was, like PySimpleGUI itself, written for me first. I found it was required to manage so many programs and so much information. Without a standalone graphical "Grep" of the > 300 programs, it made it difficult to search through these programs. I needed something like PyCharm's folder search and that gets old very quickly.

The trend I notice is that as have a need, it's initially filled by an existing tool. If I find I use that capability frequently and the interface to the existing tool would be better if expanded, then it's time to consider writing my own tool.

Install Stats

This morning, what I'm finding puzzling about yesterday's release of the project psgdemos on PyPI is that downloads of the project began almost immediately, prior to announcing anything. The 1.0.0 release and others was installed by other people.

There is no matching GitHub repo to the project so I'm scratching my head a little on how this is happening other than maybe there being a "Watch" set up by some folks that will automatically download new posts to PyPI.

Other releases to PyPI, like the psgcompiler, didn't have the same explosive numbers as the release yesterday, so I'm discounting the automated download theory a little. Someday I'll find an answer, in the meantime, it doesn't actually matter. It's a curiosity and not worth spending any time on.

YouTube Video Planned

As stated numerous times, the Demo Programs are one of the "Pillars" of the PySimpleGUI project. They are every bit as important as the documentation. If you've taken the Udemy course, then you know that nearly every lesson starts with me using the Demo Browser to show how to locate Demo Programs that may be helpful to the topic being taught.

Because it's such an important part of the project, it has a number of features interesting features that are maybe not immediately obvious (like it can be used with ANY project that has a tree of files, not just PySimpleGUI Demos), I think it could benefit from a YouTube video. I'll try to get one posted over the weekend.

Release of 4.57.0 Soon

As usual, the changes on GitHub have been piling up and need to get released to PyPI. Currently, 16 changes have gone in according to the change notes. Nothing huge, but I get nervous when there are a lot of changes in a single release. There are some features and enhancements I wanted to get in there first, but the Udemy Exercise project is soaking up the majority of my time.

Thank you supporters!!!

I really can't stress enough the gratitude for the help from the PySimpleGUI community.

image

Your financial help is enabling the project to keep moving forward and alive. I'm so grateful for the generosity. It truly is enabling the project to continue. PySimpleGUI can finally, to some degree, stand on its own.

Your kind words have been a joy to read from the July 2018 initial release date. Thank you for taking a moment to recognize the help Jason is providing. I'm sure he appreciates it, and I certainly do!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
16 participants