[Tutor] graphics library for teaching Python
Mike Barnett
mike_barnett at hotmail.com
Fri Dec 21 12:15:02 EST 2018
>There are two sub-topics I'm interested in - (1) graphics, as in drawing interesting pictures or art, or using diagrams for data visualization. (2) Simple games, with the use of sprites.
Can you post some images of similar programs / graphics you are wanting to create? It would be extremely helpful to see concrete "targets". Then I can better inform you if PySimpleGUI is capable of doing what you seek.
I've recently been writing more games using PySimpleGUI to see what's missing in the SDK, to determine new features that will help developers.
For data visualization, there's Matplotlib and Pyplot, both integrate with PySimpleGUI very well. Someone mentioned Turtle, it too integrates well by using a tkinter canvas.
I've been doing simple graphs by using the drawing primitives and games using images that I often include in the source code. The Uno Game for example has all of the cards included in the .py file.
Some examples:
Bar chart:
https://gist.github.com/MikeTheWatchGuy/fd79baad627ae879bb74437427ad4ff0
Simple Matplotlib:
https://gist.github.com/MikeTheWatchGuy/33579888cd976e2ef0231869bba38bb4
Simple plotting - sine wave:
https://gist.github.com/MikeTheWatchGuy/397b681d1b3863a74936724fdfd1ea34
Scrolling bar chart:
https://user-images.githubusercontent.com/13696193/47611749-18964c80-da42-11e8-93c4-6821a6fce488.gif
Matplotlib integration:
https://user-images.githubusercontent.com/13696193/50046965-cb664c80-007a-11e9-9470-b7d1ab3fa20e.gif
Some simple games
Conway's Game of Life:
https://user-images.githubusercontent.com/13696193/50244709-9e79a880-039e-11e9-9b51-733357a87c68.gif
Uno Card Game:
https://user-images.githubusercontent.com/13696193/49945232-67952580-feba-11e8-90c8-7dc31c5f7c67.gif
Turtle:
https://user-images.githubusercontent.com/13696193/49346588-b644f300-f662-11e8-8c83-44c74aedf89f.gif
A Crossword Puzzle GUI:
https://user-images.githubusercontent.com/13696193/47968340-98ba4480-e036-11e8-9d44-8a39ac174533.jpg
Chess GUI:
https://user-images.githubusercontent.com/13696193/47380967-b6012180-d6cc-11e8-946d-a646921fb8d0.gif
These are all tkinter based examples.
While PySimpleGUI does have a Qt port, it's not as complete when it comes to these graphics primitives and integration with Matplotlib.
-mike
More information about the Tutor
mailing list