-
Notifications
You must be signed in to change notification settings - Fork 14
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
Thanks for the ideas! #2
Comments
Thanks! I really like the improvements that you've made in the updated versions. Believe it or not, the only reason I used the dictionary was because I was trying to figure out a way to write the fewest lines of code that would be reasonably possible and still make it easy to read. I had originally used a function, but then realized I could cut out about 4 or 5 lines by using the dictionaries instead. I tried a different approach in this video... and used PowerPoint... yes...I did the entire video in PowerPoint. I liked the result so I think I'll probably use it more going forward. |
It was VERY well done. My mouth was open the entire duration. I've not seen someone teach me PySimpleGUI quite like this. At one time I was using lambdas to create these custom Elements, but kinda got yelled at for it because I directly named and called it. But, I may bring it back again.... Lemme know what you think about doing that. I think I used it in the Uno Game originally but may have removed it. It's another thing that I got from reading a user's code. |
Oh, and I started using keys with the format: The dash, for me, makes them more visible. One point that I didn't realize people have not been picking up on is the keys can be anything. They can be an object, they can be a FUNCTION, tuple, anything. |
I added a test for Speaking of other stuff... there's now a metadata field in all of the Element's constructors. You're free to store whatever you want in there and can access it directly using I hesitate to provide it however as I don't want to see it used in a weird way that attempts to mold PySimpleGUI into the older architectures. I think a friend of mine may be using it in a designer he's been working on. I think if you make the key a callable, then you may need that metadata field to pass through something important. You can make keys be objects too. Or a tuple with a lambda and ? Or...... It's been very inspirational to see your video. HUGE boost from that last one! It's got me excited again. Another weird change I made that isn't well advertised as I've not been using it yet, is that you can "call a window" and it will perform the read. This means you can essentially drop these literal characters I'm torn about using it, but damn, I love the minimal code you're left with. event, values = window() |
Oh, and elements are callable too. You could potentially drop any window['-display-']("The first field is always value") |
Second to strings as Keys, I use tuples. This is very helpful when you've got a grid of anything. Say, a grid of buttons, or a grid of input text boxes that look like a spreadsheet. It makes sense that I'm pretty sure I use tuples in the chess game too. |
I'll have to remember the index method.. that could come in handy! Calling the window directly is interesting... it would feel like |
Yea, it's sorta like that... except it is still an object. Elements are callable and so are windows. When you call an element, it calls the |
I would like to get your permission to post some screenshots of your PySimpleGUI apps on the GitHub. I have an Issue that has screenshots of other people's creations. I need to break out another one that just has the best of all of them... mine and other people's too. A gallery of sorts. The problem with using an Issue like I did is that it hides entries when you get too many. So most of the good screenshots are hidden. |
absolutely. go for it if you see anything worthy of posting. :-) |
By the way, this is the BEST forum I've ever been a part of: It's a paid forum however, which is perhaps why it's filled with nice people. If you're really into Python, it's a "Safe Space" to ask any kind of question, make any kind of statement and you'll be treated with respect. |
Wanted to say thank you so much for the support you've shown in your videos.
One of the reasons I like to read as much PySimpleGUI code that other people have written is that I learn something, every time, even from complete beginners.
Your trick of using a dictionary for the parameters was really clever and not a technique I've seen used like this. I normally define a new function that returns an Element when I have repeated parameters and then call that function instead of using the Element itself.
I was surprised and really glad to see you're using the latest and greatest techniques such as the element lookup using
window[element_key]
. You're clearly paying attention 😊Your video skills are awesome. I don't have animations or any of those other goodies that you use that really drive home the topics. LOVED the one of showing [ ] around each row of an actual window. In 5 seconds the structure was completely understandable.
Really appreciate what you've done. Thank you.
The text was updated successfully, but these errors were encountered: