From glingl at aon.at Sat Oct 23 06:29:02 2004 From: glingl at aon.at (Gregor Lingl) Date: Sat Oct 23 06:29:04 2004 Subject: [Idle-dev] [Tutor] How to explore Tkinter interactively with IDLE 1.0 Message-ID: <3F73545D.3080006@aon.at> Hi Pythonistas! Today I'd like to ask a question, which at first may look a bit technical, but which in fact for me is of high didactical importance. It concerns the proper use of IDLE in Python 2.3. With Python 2.2 (and IDLE 0.8) I used to use IDLE interactively with my students to explore different features of Tkinter. I'll give you two short examples: 1. Exploring Widgets: >>> root = Tk() >>> cv = Canvas(root, bg="white") >>> cv.pack() >>> btn = Button(root,text="Push") >>> btn.pack() >>> btn.config(bg="red") >>> # pushing the button doesn't do anything! >>> def action(): cv.create_rectangle(50,50,150,100,fill="red") >>> btn.config(command=action) >>> # pushing button creates red rectangle >>> cv.find_all() (1,) >>> cv.move(cv.find_all()[0], 100,150) >>> # rectangle moved , now create a new one >>> # or config existing widgets or canvasitems etc. etc. Shortly, learn how Tkinter works 2. Using turtle-graphics >>> from turtle import * >>> forward(100) A Canvas pops up and the turtle starts to move and remains ready for the user to interact with her interactively. Alas! Both examples don't work in ordinary IDLE 1.0 - mode I'm well aware of the advantages of IDLE 1.0, especially the one always to have a clean workspace for testing programs - and I'd like to port as much of them to a customized development environment I use in my classes. Now, I'm considering to work with both of the two modes in my classes, although I'm not sure, if this will be easy to explain to my students. How do you proceed to "keep it as simple as possible, but not simpler?" Are there other ways for developing Tkinter-GUI-programs interactively. Specifically: can the turtle.module only be used interactively (as intended) with the IDLE -n switch? Although there are many other graphics modules around I certainly will stick to using Tkinter (and IDLE), because I consider it to be a big advantage for beginners to start with tools as they come out of the box. (Aside: nevertheless I use to use IDLE with pythons -Qnew - switch to avoid complications with division, i. e. In my classes I silently import the future - one of my means to minimize computer-hatred ;-) ) Therefore I'm interested in every comment and every idea on how to use the new IDLE optimally for educational purposes. So I'll post this question (in contrast to my usual habit) on tutor, edu-sig and idle-dev. This will remain an exception. Regards Gregor Lingl P.S.: The new possibilities of printing the content of windows and of customizing the appearance of IDLE (fonts, colors etc.) easily e.g. for use with a beamer in a classroom is imho a big advance. Especially when I try to convince my colleagues to use Python, who, accustomed to the usual Windows, VisualBasic etc. comfort, used to critisize the spartanic features of the old IDLE. If you believe it or not, for many teachers (and students) those things matter! P.P.S: Moreover a gentle update of Dennies gentle introduction to the use of IDLE would be a hit! _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor From glingl at aon.at Sat Oct 23 06:29:03 2004 From: glingl at aon.at (Gregor Lingl) Date: Sat Oct 23 06:29:04 2004 Subject: [Idle-dev] [Tutor] Additional remark concerning -Qnew with IDLE 1.0 Message-ID: <3F7356A2.80706@aon.at> Hi, just observed (for the second time :-( ) that the -Qnew switch dowsn't work with IDLE 1.0 except in -n mode. I.e.: With python.exe -Qnew idle.pyw IDLE does not perform float-division with integer arguments, whereas with python.exe -Qnew idle.pyw -n new division works. This seem strange and inconsistent? Regards Gregor Lingl _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor From noamr at myrealbox.com Sat Oct 23 19:58:43 2004 From: noamr at myrealbox.com (Noam Raphael) Date: Mon Oct 25 05:22:17 2004 Subject: [Idle-dev] [Tutor] How to explore Tkinter interactively with IDLE 1.0 Message-ID: <417A9BD3.1070107@myrealbox.com> Hello, I have submitted a sourceforge patch that lets you work interactively with Tkinter in IDLE. This is its page: http://sourceforge.net/tracker/index.php?func=detail&aid=989712&group_id=5470&atid=305470 You should apply the patch, which changes the file run.py, and Tk should work just as it works in the textual shell. I Hope it helps, Noam From glingl at aon.at Tue Oct 26 09:28:35 2004 From: glingl at aon.at (Gregor Lingl) Date: Tue Oct 26 09:28:36 2004 Subject: [Idle-dev] [Tutor] How to explore Tkinter interactively with IDLE 1.0 Message-ID: <3F73545D.3080006@aon.at> Hi Pythonistas! Today I'd like to ask a question, which at first may look a bit technical, but which in fact for me is of high didactical importance. It concerns the proper use of IDLE in Python 2.3. With Python 2.2 (and IDLE 0.8) I used to use IDLE interactively with my students to explore different features of Tkinter. I'll give you two short examples: 1. Exploring Widgets: >>> root = Tk() >>> cv = Canvas(root, bg="white") >>> cv.pack() >>> btn = Button(root,text="Push") >>> btn.pack() >>> btn.config(bg="red") >>> # pushing the button doesn't do anything! >>> def action(): cv.create_rectangle(50,50,150,100,fill="red") >>> btn.config(command=action) >>> # pushing button creates red rectangle >>> cv.find_all() (1,) >>> cv.move(cv.find_all()[0], 100,150) >>> # rectangle moved , now create a new one >>> # or config existing widgets or canvasitems etc. etc. Shortly, learn how Tkinter works 2. Using turtle-graphics >>> from turtle import * >>> forward(100) A Canvas pops up and the turtle starts to move and remains ready for the user to interact with her interactively. Alas! Both examples don't work in ordinary IDLE 1.0 - mode I'm well aware of the advantages of IDLE 1.0, especially the one always to have a clean workspace for testing programs - and I'd like to port as much of them to a customized development environment I use in my classes. Now, I'm considering to work with both of the two modes in my classes, although I'm not sure, if this will be easy to explain to my students. How do you proceed to "keep it as simple as possible, but not simpler?" Are there other ways for developing Tkinter-GUI-programs interactively. Specifically: can the turtle.module only be used interactively (as intended) with the IDLE -n switch? Although there are many other graphics modules around I certainly will stick to using Tkinter (and IDLE), because I consider it to be a big advantage for beginners to start with tools as they come out of the box. (Aside: nevertheless I use to use IDLE with pythons -Qnew - switch to avoid complications with division, i. e. In my classes I silently import the future - one of my means to minimize computer-hatred ;-) ) Therefore I'm interested in every comment and every idea on how to use the new IDLE optimally for educational purposes. So I'll post this question (in contrast to my usual habit) on tutor, edu-sig and idle-dev. This will remain an exception. Regards Gregor Lingl P.S.: The new possibilities of printing the content of windows and of customizing the appearance of IDLE (fonts, colors etc.) easily e.g. for use with a beamer in a classroom is imho a big advance. Especially when I try to convince my colleagues to use Python, who, accustomed to the usual Windows, VisualBasic etc. comfort, used to critisize the spartanic features of the old IDLE. If you believe it or not, for many teachers (and students) those things matter! P.P.S: Moreover a gentle update of Dennies gentle introduction to the use of IDLE would be a hit! _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor From glingl at aon.at Tue Oct 26 09:28:35 2004 From: glingl at aon.at (Gregor Lingl) Date: Tue Oct 26 09:28:37 2004 Subject: [Idle-dev] [Tutor] Additional remark concerning -Qnew with IDLE 1.0 Message-ID: <3F7356A2.80706@aon.at> Hi, just observed (for the second time :-( ) that the -Qnew switch dowsn't work with IDLE 1.0 except in -n mode. I.e.: With python.exe -Qnew idle.pyw IDLE does not perform float-division with integer arguments, whereas with python.exe -Qnew idle.pyw -n new division works. This seem strange and inconsistent? Regards Gregor Lingl _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor