Re: [Tutor] Recommended Resurce or strategy for beginning students
I like this concept. The only additional information I would add in relation to any training or educational information. You must include accessibility. As the laws in many countries require this to be a part of the product. So it is a perfect time to educate students on this important topic. A high level awareness is required only. Introducing the basics. Keyboard navigation, colour contrast, ensuring the GUI works with a screen reader. The platforms used for GUI should do most of the heavy lifting. The other aspect is you need to ensure the course is accessible to possible disable students for now and the future. If you are based in the Usa. Then there could be legal requirements for this. Not sure. Out of my scope of focus in the accessibility world. A bare minimum is to understand the bare basics which are called POUR. Reference W3C for the explaination. Sean My experience is the part > On 23 Jan 2019, at 1:17 am, Mike Barnett wrote: > > I like the idea of starting out right away on a GUI. I know this is > completely backwards to what would normally be taught, but hear me out. Kids > today are used to GUI interfaces. They're on their phones, their computers, > their TV sets. > > Why not teach kids to output to a window instead of a command line? What if > it's just was easy, or easier, to work with a GUI as it is the command line? > > To output to the command line in standard Python: > print('my string', variable1, variable2) > > To output the same information to a window using PySimpleGUI: > Popup('my string', variable1, variable2) > > Or, you can "print" to a debug window if that's your thing. > Print('takes the same parameters as print') > > If the ultimate goal is to teach kids about how to design a GUI window, how > to lay out a GUI using good user interface design principals, then it would > be nice to get the GUI coding out of the way and let the focus instead be on > the GUI itself. This is when having a drag-and-drop Designer Tool is handy. > If not, then the next best thing is a simple programming interface. > > PySimpleGUI was designed so that the code visually matches the window layout. > > > It's capable of duplicating pretty much any layout and widget combination > that you can create coding directly to tkinter's (or Qt's or WxPython's) > interfaces. PySimpleGUI simply creates and executes the "boilerplate" code > that is often brought up when GUIs are discussed. > > A goal was to remove all of the boilerplate code and provide a programmer > with a simple, friendly and flexible set of APIs. You write a single line of > code per row of widgets in your window plus a 1/2 dozen lines to implement > the event loop. > > I don't see the harm in approaching the problem from a different direction. > It could be wildly successful. Or... not... The worst that can happen is > you screw up a classroom full of future programmers, creating a warped vision > that GUIs can be fun and easy. > > > @mike > > -Original Message- > From: Matthew Polack > Sent: Tuesday, January 22, 2019 1:58 AM > To: tutor@python.org > Subject: [Tutor] Recommended Resurce or strategy for beginning students > > Hi All, > > In our growing school we're teaching Python programming for the first time as > an elective subject with Year 9 and 10 students. (Had a dabble at this last > year with 3 students in Year 11) > > I'm wondering what specific resource or stategy people would recommend for > absolute beginners? > > ie. a course or program, book,...set of activities to follow that > strategically introduces and develops key skills. > > At this age level I don't think we need to be achieving 'rocket science'..but > rather giving the students a good solid introduction. > > Some of the leadership wanted me to use this programming in combination with > building robots...I've even wondered whether this is trying to achieve too > many things...and we're better off focused on programming itself... but am > open to this idea too... > > I've had a play with using the excellent PySimpleGUI...which is an excellent > resource for building a GUI...but I've realised before doing too much of this > we might need to get a grip on core fundamentals > > The challenge is trying to find a way to making this 'fun' for students > whilst also having them genuinely learn rather than just 'copying pasting' > code...achieving something that looks good...but not really understanding > what they are doing. > > So far my strategy will be: > > 1.) Establish some core basics(utlising some form of 'course',,,which goes > through basics of syntax..variables...loops etc. utilising just raw > code...(probably a simple 'Adventure Game') > 2.) Build some simple programs using PySimple GUi..eg. Some quiz games etc. > (there are some great examples on Github by another teacher and also the > author Mike of PySimpleGUI. > 3.) Possibly explore robotics. > > Can a
Re: [Tutor] Interactive editing of variables.
Mike, thanks for this debug tool. I might have a look at it. No that’s not the goal I’m after. I want to have a basic l input line which is already populated with a value. The value is extracted from a list of strength. Each element in the list are unique. I want to modify the string and then re-insert it back into the same element as the new modified string I’m currently look at read line or piegnurl module this might do the trick. Using GUI is way over the top for the simple thing I’m trying to do The model which Alan kindly suggested if not accessible with a screen reader. As I cannot see e.g. blind, this is a critical component of my programming. Please excuse any errors because I’m using Siri to send this email. My experience is the part > On 1 Jun 2019, at 10:05 pm, Mike Barnett wrote: > > TL;DR > There's a run-time debugger out, "imwatchingyou" that is being developed > daily, fast paced, that enables debugging without stopped your code or using > an IDE. > > I'm unsure if I'm super late to the party of if I understand the "problem" / > request properly. I apologize if I'm off-base. > > Do you want to be able to examine and modify variables while your program is > running, without breaking into it with a debugger? Is that part of it? > > If so, I've been working my ass off for a couple of weeks to do just that, > develop a realtime "watcher" / debugger. > > You'll find the project here: > https://github.com/PySimpleGUI/imwatchingyou > > At this time, you must pip install imwatchingyou. If you're concerned > because of the name "imwatchingyou", it's meant to be YOU are watching YOUR > code. If I wanted to watch your Python code, I would have named it > "makefreemoneyminingbitcoininpython". > > There is a nice screenshot, although things have been changing. There are 2 > primary windows. The brown one in the upper right of the screen is a > realtime update of all of your local variables. Then there's the large debug > window that allows you to do more including running the built-in REPL. > > There is also a version being built into the PySimpleGUI library itself so > you do not have to do any imports, etc. All PySimpleGUI will have this > watch/debug capability in it. > > > > > @mike > > -Original Message- > From: mhysnm1...@gmail.com > Sent: Saturday, June 1, 2019 4:53 AM > To: 'Alan Gauld' ; tutor@python.org > Subject: Re: [Tutor] Interactive editing of variables. > > As I thought. Easygui is not accessible at all with a screen reader due to > the underlying graphic library. Win32 could work if I could load it. Since > then I could use standard windows objects. > > Note, I didn't see anything in the quick scan I did ion the API. > > > Very frustrating and disappointing. > -Original Message- > From: Tutor On Behalf Of Alan > Gauld via Tutor > Sent: Saturday, 1 June 2019 4:50 PM > To: tutor@python.org > Subject: Re: [Tutor] Interactive editing of variables. > >> On 01/06/2019 03:53, mhysnm1...@gmail.com wrote: >> >> I have no clue on how to achieve what I want to do and the code I have >> creates an hash. As shown below: > > Thats because what you want is not a standard feature of CLI apps. > You will need to do one of the following(in order of easiness): > 1) Use a GUI - it then becomes a trivial matter > 2) Use a pseudo GUI like curses to provide cursor control > 3) Find a module that already does what you need > (maybe readline can be made to work?) > 4) Write a function yourself using screen primitives > that manage the cursor > > >> for row in description: >>text = description_rejex(row) >>if text[0] not in narration: >>Result = input(text[0]) >>narration[result] = text > > The standard tools allow you to input a new value and overwrite the existing > one. But there is no simple way to interactively modify an existing value > (and of course you would need to convert it to/from a string for that to be > possible) > >> I have had a look and cannot find an example where I can interactively >> edit a content of a variable at the command line. I do not want to use >> GUI at all. > > A GUI makes this a trivial problem. Simply display an edit control and insert > the current value as a string. Allow the user to modify it and when done read > the new value back. If you don't want to use a GUI you need to provide GUI > like controls yourself, either through an existing module or by writing one. > Something like easygui would be eminently suitable. But even vanilla Tkinter > is almost trivial. > > The curses library will do it but that is not standard on Windows and I've > heard varying reports of how well it works there. > > The readline library allows basic editing of the commands line but I'm not > sure how you would insert your variable into the command line initially... > > For windows there are a couple of modules available that provide low level > cursor control and c