End of 2010... Happy \N
Code Blit: The string module has translate and maketrans, through multiple versions. In per 3.x, an optional argument listed "letters to delete". The first argument was a kind of mapping, of 256 symbols to itself, except with some letters changed, what we would call a "permutation" in group theory (not promising a bijectional one-to-one mapping, no way, more likely surjective, do we agree?). http://www.youtube.com/watch?v=xKNX8BUWR0g Here we are in 2.6, where the bytes type is not yet operative. IDLE 2.6.5
b'a' 'a' type(b'a') <type 'str'>
Now let's replay that action in 3.1:
b'a' b'a' type(b'a') <class 'bytes'>
Here's my idea of a punctuation filter in 3.x, where the delete characters clause is now a delete bytes clause in the byte type superobject. import string def filterpunc(thestr): return thestr.encode('utf-8').translate(bytes.maketrans(b'',b''), string.punctuation.encode('utf-8')).decode('utf-8') See: http://diveintopython3.org/strings.html http://www.devx.com/opensource/Article/42659/1763 if curious. This'd be used to strip string.punctuation characters out of any string. Other solutions possible, including with regexps. Suggestions for Features (SFFs -- not as prestigious or important as PEPs but sometimes the genetic precursor of a PEP). Save Session in IDLE or other PyShell: This is probably already out there, in IPython or one of those. It's so cool to be able to interactively bind names to working code in memory, but when you resume your session later, all that has gone away. In some other shell environments, you have the option to hibernate and resume, Smalltalk's being the most famous. Would it come with a source code snapshot version that encapsulates all the definitions as runnable code? The latest version of f, all the latest object values? That's another way to "pickle", to just write out a module that recreates what was there, when run. Python in Mathland: A link to a recent summary that mentions Python quite a bit: http://groups.google.com/group/mathfuture/browse_thread/thread/3d642708c2f2a... Kirby
Suggestions for Features (SFFs -- not as prestigious or important as PEPs but sometimes the genetic precursor of a PEP).
Save Session in IDLE or other PyShell:
Hmmm, that didn't format so well for the edu-sig archive, sorry 'bout that. For a host of reasons, having a source code version at one's fingertips would be more problematic than a generic "state saver" that lets you hibernate or snapshot a session. However, if it came with the text console, so you could scroll back.... (VFP has this, one of my other shell / chat windows). I forget which shell lets you automatically shift interactively defined functions and classes to a corresponding program editor, with a simple click. In IDLE it's more a cut and paste operation, and then you need to trim out the >>>. A highlight of 2010 for me was Steve Holden trashing IDLE and saying what could leave Python feeling too retro is the lack of a really state-of-the-art shell and/or interactive front end to the interpreter ("chat window, talk to the python"). We did some comparing with the Eclipse implementation (PyDev) which I've been using more in 2010. But I miss my Akbar font. PyShell and PyCrust... worthy efforts, making wxPython the basis / platform. PythonCard... thinks to draw inspiration from, as ahead of their time? Will the better Python IDE emerge? Wing? Komodo? A lot of people aren't shell freaks and so don't care that much. You use a coding language to write scripts, not to interact, not too "save state" from interactive sessions. These are different mindsets in some way, with many of us going back and forth depending on the task. Lets remember though, many newcomers to Python stick around because of the interactivity. That's why I think Steve was on target. IDLE was totally state of the art in its day, a cross-platform GUI widget library backing it up, the Tk library with Tkinter. Very innovative. Worth every penny. Kirby
Happy New Year all! Please enjoy my YouTubes and BlogSpots! HTH, A. Jorge Garcia Applied Math and CompSci http://shadowfaxrant.blogspot.com http://www.youtube.com/calcpage2009
Greetings Jorge. Was just checking your blogs. This find is fantastic. One of your students? http://www.youtube.com/watch?v=vzuvAvUvAtQ I'll pass this on the math-teach and mathfuture, to of my frequent haunts / hangouts. Kirby On Sat, Jan 1, 2011 at 7:21 AM, A. Jorge Garcia <calcpage@aol.com> wrote:
Happy New Year all! Please enjoy my YouTubes and BlogSpots!
HTH, A. Jorge Garcia Applied Math and CompSci http://shadowfaxrant.blogspot.com http://www.youtube.com/calcpage2009
_______________________________________________ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
Hi Kirby, Glad you liked that YouTube! Yes, that is one of my AP Calculus BC students. He is one of those rare very well-rounded students. In other words, he's not just good at math and science, he's good at everything! He's our valedictorian this year and he was the lead in our school play. He and his sister are very musically inclined as you can tell in the video. He came up with the lyrics and played the piano while his sister sang in that YouTube. He also did all the video editing and sound recording, etc. Regards, A. Jorge Garcia Applied Math and CompSci http://shadowfaxrant.blogspot.com http://www.youtube.com/calcpage2009
Fantastic. Maybe he'll do something around Python someday. His sister did a wonderful job with the vocals. Speaking of Python, I noticed how Vi got some Python references in, not just in drawing the snakes, but in showing a tiny fragment of the language. open( ). http://www.youtube.com/user/Vihart#p/u/3/heKK95DAKms She also said "snakes on a plane" which reminds me of this xkcd cartoon: http://xkcd.com/107/ Vi also got into the uroborus quite a bit, which is a pet topic for me as well: http://www.flickr.com/photos/17157315@N00/5314179162/ ** Kirby **: If you're into exotic cars at all, to the right in the same photostream are some only recently published pictures of Car #4 (Dymaxion fleet). (complete slides from which the above is listed: http://www.4dsolutions.net/presentations/connectingthedots.pdf ). On Sat, Jan 1, 2011 at 2:40 PM, A. Jorge Garcia <calcpage@aol.com> wrote:
Hi Kirby,
Glad you liked that YouTube! Yes, that is one of my AP Calculus BC students. He is one of those rare very well-rounded students. In other words, he's not just good at math and science, he's good at everything!
He's our valedictorian this year and he was the lead in our school play. He and his sister are very musically inclined as you can tell in the video. He came up with the lyrics and played the piano while his sister sang in that YouTube. He also did all the video editing and sound recording, etc.
Regards, A. Jorge Garcia Applied Math and CompSci http://shadowfaxrant.blogspot.com http://www.youtube.com/calcpage2009
Vi Hart is amazing. I've seen that YouTube before. You sent that link to edu-sig some weeks ago, no? I recently switched from using SAGE online in class to using python scripts on a Linux server. I wonder if I could do some graphics in this setting using python in my introCS class (aka Computer Math). I've been looking at vpython, GASP, pygame. Whatever happened to turtle graphics? My students login to my sever via ssh, ie ssh userid@10.5.129.25 or if they need to tunnel graphics ssh -Y userid@10.5.129.25 Can they do graphics with one of the aforementioned python libraries this way? TIA, A. Jorge Garcia Applied Math and CompSci http://shadowfaxrant.blogspot.com http://www.youtube.com/calcpage2009
On Sat, Jan 1, 2011 at 5:22 PM, A. Jorge Garcia <calcpage@aol.com> wrote:
Vi Hart is amazing. I've seen that YouTube before. You sent that link to edu-sig some weeks ago, no?
I recently switched from using SAGE online in class to using python scripts on a Linux server. I wonder if I could do some graphics in this setting using python in my introCS class (aka Computer Math). I've been looking at vpython, GASP, pygame.
In my Martian Math class last summer we used VPython to get some interesting graphics. These were newcomer Earthlings who'd mostly never seen Python before, but had a reputation of being quick learners, privileged in the talent department. My approach was to provide the source code pre-written, as scaffolding, and just have them tweak, building literacy that way. http://www.flickr.com/photos/17157315@N00/4863299407/in/set-7215762296142583... (screen shot) http://www.4dsolutions.net/satacad/martianmath/mm21.html (a lesson plan) http://wikieducator.org/Martian_Math (more background re curriculum) I explain this up front otherwise it looks like I achieved a miracle, and so must be lying, as no one believes in miracles. No, I just used the standard language learning technique of reinforcing recognition over recall, if that makes any sense to anyone.
Whatever happened to turtle graphics? My students login to my sever via ssh, ie ssh userid@10.5.129.25 or if they need to tunnel graphics ssh -Y userid@10.5.129.25
What is your problem with turtle graphics again, might have missed? Oh, I think I get it (see below). Gregor Lingl here on edu-sig has been maintaining that package, which is cross-platform because working in Tk. ** But then you probably have any number of Java applets and free Logo implementations, plus of your school spends dough on software, the sky's the limit on cartoony 3D Logo worlds, or so I'm led to believe (my budget hovers around negative zero, where software is concerned).
Can they do graphics with one of the aforementioned python libraries this way?
Oh, I maybe see the problem, you're talking about more like a dumb terminal setup with X running in a server session if at all. You're going over the network to get Python. Do they get a GUI desktop? GNOME? Sounds like they don't. No graphical browser in this world either eh? In my Martian Math class, each kid had their own super fancy Apple with giant flatscreen. Privileged Earthlings these were. We used IDLE, which works better with VPython than it does with its own native Tk. Kirby
TIA, A. Jorge Garcia Applied Math and CompSci http://shadowfaxrant.blogspot.com http://www.youtube.com/calcpage2009
** deeply buried mention of Gregor in this recap of some 2010 activities on another list, FYI: http://groups.yahoo.com/group/synergeo/message/63983
Oh, I maybe see the problem, you're talking about more like a dumb terminal setup with X running in a server session if at all. You're going over the network to get Python. << Something like that...
Do they get a GUI desktop? GNOME? <<
Well, I set up 25 PCs in my classroom on a gigabit LAN. Each PC is running Ubuntu Desktop 10.04 - so, yes they have gnome and yes they have a GUI browser (Firefox). I took one of these PCs and called it the "server/teacher station." On this PC I added vsftp to share files with my students and openssh so they can login to my PC as a server to save their work. I call my PC the "teacher station" because I use it with a PC Projector and a Slate (bluetooth remote mouse) mimicking a SmartBoard setup to demo code and give notes and even show some educational YouTube! I recently added python and IDLE to this server: apt-get install python apt-get install idle We tried IDLE but prefer python scripts. So, I have my students login to the server via ssh from their "student stations" and write python scripts like hello.py which they chmod to make executable chmod 755 hello.py which works fine if the first line in the script is #!/usr/bin/python I tried to import turtle in a script using this environment but turtle was not found. You say VPython works well with IDLE? I was hoping to add VPython, GASP or turtle graphics to my scripts. What do you think? TIA, A. Jorge Garcia Applied Math and CompSci http://shadowfaxrant.blogspot.com http://www.youtube.com/calcpage2009
Pardon my jumping in, but is turtle available from the interactive shell? The turtle module should be in /usr/lib/Python2.6/lib-tk on an Ubuntu 10.4 installation. If it is, then it should work fine from your scripts. Is it available for you when you log onto the machine directly? Cheers, Vern On Sat, Jan 1, 2011 at 9:12 PM, A. Jorge Garcia <calcpage@aol.com> wrote:
Oh, I maybe see the problem, you're talking about more like a dumb terminal setup with X running in a server session if at all. You're going over the network to get Python. << Something like that...
Do they get a GUI desktop? GNOME? <<
Well, I set up 25 PCs in my classroom on a gigabit LAN. Each PC is running Ubuntu Desktop 10.04 - so, yes they have gnome and yes they have a GUI browser (Firefox).
I took one of these PCs and called it the "server/teacher station." On this PC I added vsftp to share files with my students and openssh so they can login to my PC as a server to save their work.
I call my PC the "teacher station" because I use it with a PC Projector and a Slate (bluetooth remote mouse) mimicking a SmartBoard setup to demo code and give notes and even show some educational YouTube! I recently added python and IDLE to this server:
apt-get install python apt-get install idle
We tried IDLE but prefer python scripts. So, I have my students login to the server via ssh from their "student stations" and write python scripts like hello.py which they chmod to make executable
chmod 755 hello.py
which works fine if the first line in the script is
#!/usr/bin/python
I tried to import turtle in a script using this environment but turtle was not found.
You say VPython works well with IDLE? I was hoping to add VPython, GASP or turtle graphics to my scripts.
What do you think?
TIA, A. Jorge Garcia Applied Math and CompSci http://shadowfaxrant.blogspot.com http://www.youtube.com/calcpage2009
_______________________________________________ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
-- Vern Ceder vceder@gmail.com, vceder@dogsinmotion.com The Quick Python Book, 2nd Ed - http://bit.ly/bRsWDW
On 01/01/2011 09:38 PM, Vern Ceder wrote:
Pardon my jumping in, but is turtle available from the interactive shell? The turtle module should be in /usr/lib/Python2.6/lib-tk on an Ubuntu 10.4 installation. If it is, then it should work fine from your scripts. Is it available for you when you log onto the machine directly?
Cheers, Vern
On Sat, Jan 1, 2011 at 9:12 PM, A. Jorge Garcia <calcpage@aol.com <mailto:calcpage@aol.com>> wrote:
Oh, I maybe see the problem, you're talking about more like a dumb terminal setup with X running in a server session if at all. You're going over the network to get Python. << Something like that...
Do they get a GUI desktop? GNOME? <<
Well, I set up 25 PCs in my classroom on a gigabit LAN. Each PC is running Ubuntu Desktop 10.04 - so, yes they have gnome and yes they have a GUI browser (Firefox).
I took one of these PCs and called it the "server/teacher station." On this PC I added vsftp to share files with my students and openssh so they can login to my PC as a server to save their work.
I call my PC the "teacher station" because I use it with a PC Projector and a Slate (bluetooth remote mouse) mimicking a SmartBoard setup to demo code and give notes and even show some educational YouTube! I recently added python and IDLE to this server:
apt-get install python apt-get install idle
We tried IDLE but prefer python scripts. So, I have my students login to the server via ssh from their "student stations" and write python scripts like hello.py which they chmod to make executable
chmod 755 hello.py
which works fine if the first line in the script is
#!/usr/bin/python
I tried to import turtle in a script using this environment but turtle was not found.
You say VPython works well with IDLE? I was hoping to add VPython, GASP or turtle graphics to my scripts.
What do you think?
TIA, A. Jorge Garcia Applied Math and CompSci http://shadowfaxrant.blogspot.com http://www.youtube.com/calcpage2009
_______________________________________________ Edu-sig mailing list Edu-sig@python.org <mailto:Edu-sig@python.org> http://mail.python.org/mailman/listinfo/edu-sig
-- Vern Ceder vceder@gmail.com <mailto:vceder@gmail.com>, vceder@dogsinmotion.com <mailto:vceder@dogsinmotion.com> The Quick Python Book, 2nd Ed - http://bit.ly/bRsWDW
_______________________________________________ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig From what I've read so far, the students are SSHing into a sever, and writing their scripts from there (nano, vi, etc?). AFAIK, SSH is usually just shell, which means no GUI from the host, and they can't use turtle because it is a GUI app, using Tkinter IIRC.
On Sat, Jan 1, 2011 at 9:45 PM, Corey Richardson <kb1pkl@aim.com> wrote:
On 01/01/2011 09:38 PM, Vern Ceder wrote:
Pardon my jumping in, but is turtle available from the interactive shell? The turtle module should be in /usr/lib/Python2.6/lib-tk on an Ubuntu 10.4 installation. If it is, then it should work fine from your scripts. Is it available for you when you log onto the machine directly?
Cheers, Vern
On Sat, Jan 1, 2011 at 9:12 PM, A. Jorge Garcia <calcpage@aol.com Well, I set up 25 PCs in my classroom on a gigabit LAN. Each PC is running Ubuntu Desktop 10.04 - so, yes they have gnome and yes they have a GUI browser (Firefox).
I took one of these PCs and called it the "server/teacher station." On this PC I added vsftp to share files with my students and openssh so they can login to my PC as a server to save their work.
I call my PC the "teacher station" because I use it with a PC Projector and a Slate (bluetooth remote mouse) mimicking a SmartBoard setup to demo code and give notes and even show some educational YouTube! I recently added python and IDLE to this server:
apt-get install python apt-get install idle
We tried IDLE but prefer python scripts. So, I have my students login to the server via ssh from their "student stations" and write python scripts like hello.py which they chmod to make executable
chmod 755 hello.py
which works fine if the first line in the script is
#!/usr/bin/python
I tried to import turtle in a script using this environment but turtle was not found.
You say VPython works well with IDLE? I was hoping to add VPython, GASP or turtle graphics to my scripts.
What do you think?
TIA, A. Jorge Garcia Applied Math and CompSci http://shadowfaxrant.blogspot.com http://www.youtube.com/calcpage2009
From what I've read so far, the students are SSHing into a sever, and writing their scripts from there (nano, vi, etc?). AFAIK, SSH is usually just shell, which means no GUI from the host, and they can't use turtle because it is a GUI app, using Tkinter IIRC.
_______________________________________________ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
Right, the turtle and Tkinter are GUI apps, but the OP said they connect with the -Y parameter for X11 forwarding, so it should open an X11 window on their machines - this is standard behavior for ssh. And the OP said turtle was not found, not that a screen couldn't be opened. Cheers, Vern -- Vern Ceder vceder@gmail.com, vceder@dogsinmotion.com The Quick Python Book, 2nd Ed - http://bit.ly/bRsWDW
Right, the turtle and Tkinter are GUI apps, but the OP said they connect with the -Y parameter for X11 forwarding, so it should open an X11 window on their << machines - this is standard behavior for ssh. And the OP said turtle was not found, not that a screen couldn't be opened. <<
Thanx, Vern, you are exactly correct. My students have run several GUI apps, for example using java, via X11 forwarding in this manner. I tried sample python turtle code I found on the web and got an import error. I was logged in directly on the server. TIA, A. Jorge Garcia Applied Math and CompSci http://shadowfaxrant.blogspot.com http://www.youtube.com/calcpage2009
On Sat, Jan 1, 2011 at 10:55 PM, A. Jorge Garcia <calcpage@aol.com> wrote:
Right, the turtle and Tkinter are GUI apps, but the OP said they connect with the -Y parameter for X11 forwarding, so it should open an X11 window on their << machines - this is standard behavior for ssh. And the OP said turtle was not found, not that a screen couldn't be opened. <<
Thanx, Vern, you are exactly correct. My students have run several GUI apps, for example using java, via X11 forwarding in this manner.
I tried sample python turtle code I found on the web and got an import error. I was logged in directly on the server.
So is turtle.py in /usr/lib/Python2.6/lib-tk ? It should be, according to the python2.6 package manifest... if not, maybe reinstalling the package would help. If that fails, downloading the python source tarball and manually putting it there should do the trick, assuming nothing else is missing. (and if IDLE runs, you should be OK, Tkinter-wise). Cheers, Vern
TIA, A. Jorge Garcia Applied Math and CompSci http://shadowfaxrant.blogspot.com http://www.youtube.com/calcpage2009
-- Vern Ceder vceder@gmail.com, vceder@dogsinmotion.com The Quick Python Book, 2nd Ed - http://bit.ly/bRsWDW
On 01/01/2011 10:01 PM, Vern Ceder wrote:
On Sat, Jan 1, 2011 at 9:45 PM, Corey Richardson <kb1pkl@aim.com <mailto:kb1pkl@aim.com>> wrote:
On 01/01/2011 09:38 PM, Vern Ceder wrote:
Pardon my jumping in, but is turtle available from the interactive shell? The turtle module should be in /usr/lib/Python2.6/lib-tk on an Ubuntu 10.4 installation. If it is, then it should work fine from your scripts. Is it available for you when you log onto the machine directly?
Cheers, Vern
On Sat, Jan 1, 2011 at 9:12 PM, A. Jorge Garcia <calcpage@aol.com <mailto:calcpage@aol.com> Well, I set up 25 PCs in my classroom on a gigabit LAN. Each PC is running Ubuntu Desktop 10.04 - so, yes they have gnome and yes they have a GUI browser (Firefox).
I took one of these PCs and called it the "server/teacher station." On this PC I added vsftp to share files with my students and openssh so they can login to my PC as a server to save their work.
I call my PC the "teacher station" because I use it with a PC Projector and a Slate (bluetooth remote mouse) mimicking a SmartBoard setup to demo code and give notes and even show some educational YouTube! I recently added python and IDLE to this server:
apt-get install python apt-get install idle
We tried IDLE but prefer python scripts. So, I have my students login to the server via ssh from their "student stations" and write python scripts like hello.py which they chmod to make executable
chmod 755 hello.py
which works fine if the first line in the script is
#!/usr/bin/python
I tried to import turtle in a script using this environment but turtle was not found.
You say VPython works well with IDLE? I was hoping to add VPython, GASP or turtle graphics to my scripts.
What do you think?
TIA, A. Jorge Garcia Applied Math and CompSci http://shadowfaxrant.blogspot.com http://www.youtube.com/calcpage2009
From what I've read so far, the students are SSHing into a sever, and writing their scripts from there (nano, vi, etc?). AFAIK, SSH is usually just shell, which means no GUI from the host, and they can't use turtle because it is a GUI app, using Tkinter IIRC.
_______________________________________________ Edu-sig mailing list Edu-sig@python.org <mailto:Edu-sig@python.org> http://mail.python.org/mailman/listinfo/edu-sig
Right, the turtle and Tkinter are GUI apps, but the OP said they connect with the -Y parameter for X11 forwarding, so it should open an X11 window on their machines - this is standard behavior for ssh. And the OP said turtle was not found, not that a screen couldn't be opened.
Cheers, Vern
-- Vern Ceder vceder@gmail.com <mailto:vceder@gmail.com>, vceder@dogsinmotion.com <mailto:vceder@dogsinmotion.com> The Quick Python Book, 2nd Ed - http://bit.ly/bRsWDW
Whoops, guess I missed the -Y switch. Nevermind :)
On Sat, Jan 1, 2011 at 6:12 PM, A. Jorge Garcia <calcpage@aol.com> wrote: << snip >>
You say VPython works well with IDLE? I was hoping to add VPython, GASP or turtle graphics to my scripts.
Yes, the VPython team built their curriculum around IDLE. Part of what Arthur used to gripe about is how a Visual install might change your IDLE settings to boot into a script (programming window) instead of into the interactive shell. Anyway, when you launch a VPython script, perhaps by hitting F5 in the program window, it brings up an independent window or even goes into full screen mode based on user parameters. Full screen 3D with commands as simple as >>> ball = sphere(origin, radius=0.5, color = colors.red)... really fantastic. Here's a Youtube of what I've done with it: http://www.youtube.com/watch?v=tp_ZycVtOKM (me babbling insanely about polyhedrons while filming Vpython script output) Given the CPU power required by real time computer graphics, I'd think you'd wanna enslave all those PCs if they're at all capable and not bring your server to its knees trying to be all things to all users. I suppose it's not either/or, i.e. using workstations individually doesn't mean they can't ssh their homework to shared depositories. Kirby
What do you think?
TIA, A. Jorge Garcia Applied Math and CompSci http://shadowfaxrant.blogspot.com http://www.youtube.com/calcpage2009
Will the better Python IDE emerge? Wing? Komodo?
What about the new open souce Ninja-IDE? http://ninja-ide.appspot.com/
participants (5)
-
A. Jorge Garcia
-
Corey Richardson
-
Fernando Salamero
-
kirby urner
-
Vern Ceder