Thursday, April 27, 2006
Lightning 2.0
Lightning Compiler (LC) is a wxPython based app. LC's purpose is to provide a friendlier environment to tests Python code snippets than the Python interpreter. It does include an interpreter (pyShell) but it is most likely to be used for its editor. You can execute the code that appears in the editing window and the output is redirected to an output window. raw_input() and input() are handled via dialogs. The basic layout (output window to the side or below the editor window) is customisable.
LC comes in a zip file with a sample app, showing how it can be embedded in other applications, as well as a sample script with doctests and a text file containing additional doctest based tests.
Since LC uses wxPython, it can not be run with a basic Python installation. If there is some interest, I might try and adapt it so that it could use Tkinter instead (as an option. However, I have no experience with Tkinter. Any help would, of course, be appreciated :-)
Sunday, April 23, 2006
Lightning Compiler with doctest support
def hello():I can simply press LC's "docTest" button or "verbose" button to run Python with doctest.
""">>> hello()
Hello!
"""
print "Hello!"
What's happening behind the scene is that the following two lines
import doctestare appended to the code in the window, all of which is saved to a file which is then executed by Python, with or without the "-v" option. The result is saved to a second file which is then displayed in LC's output window.
doctest.testmod()
Granted, if your script already includes some doctest-based testing within a "standard"
if __name__ == "__main__:"block, this addition to LC may not seem that useful; however, if you already use the "if..." block for something other than tests with doctest and have some docstrings-based tests in your code, it might be worth your while trying LC's new feature.
Thursday, April 13, 2006
Thoughts on the Shuttleworth Summit
I am going to present an admittedly one-sided view in order to invite some discussion. The reality is that Logo and Squeak have been used very successfully with learner of all ages - something I will conveniently ignore in my argumentation! Furthermore, because I want to use this post to try and provide some feedback to Kirby that he can perhaps use while he is at the summit, the depth of some of the arguments presented will definitely be less than satisfactory.
Let me jump straight into the discussion by first arguing Logo might be too complicated as a first step, for at least two reasons. In decreasing order of importance, they are: 1. Advanced geometry; 2. Too many (complicated) commands. Furthermore, I would argue that Logo is limited in its ability to introduce problems requiring analytical skills.
First, Logo (and similar turtle graphics environment) uses general two-dimensional motion. The mathematical concepts that are needed/introduced include length and angles (measured in degrees). While integer values are used, units of length are too small to be easily measurable on the screen. By contrast, rur-ple uses restricted two-dimensional motion, as combinations of either vertical or horizontal motions. The basic stepsize is easily measurable on the screen. While rur-ple is designed to introduced coordinates (which are, arguably, a fairly advanced mathematical concept), programs can be written without making any reference to this concept. Furthermore, even without writing an actual program, one can guide the robot, making it move and turn by using the keyboard; this can be useful in visually determining the order in which instructions must be written.
Note that, in a future version of rur-ple (after I complete version 1.0) will include a second environment which will be essentially a "turtle graphics" environment, like that of Logo.
Second, Logo generally include the following commands (written in non-abbreviated form): forward #, backward #, right #, left #, pen_up, pen_down, restart (cs), as well as a repeat instruction. Note that the symbol "#" refers to a numerical variable. By contrast, rur-ple's basic commands are: move(), turn_left(), pick_beeper(), put_beeper(), and turn_off(). Rur-ple also includes a repeat() instruction. One can easily make a correspondance between Logo and rur-ple's commands and see that Logo includes two extra commands (backward and right) that can be emulated by appropriate combinations of other commands. Granted, the previous argument is a bit weak... However, note that 4 of Logo's basic commands require the use of an additional numerical arguments. This may seem trivial ... but for an absolute beginner, such a combination, like "forward 5" is an advanced concept as compared with a simple instruction like move(). While it is currently not designed this way, rur-ple could (and probably should) be easily modified so that the basic instruction move() could take an optional argument, like move(5), which would more closely match Logo's syntax. This is most likely how the future "turtle" environment for rur-ple will be designed.
Another conceptual hurdle present with Logo is the concept of "pen_up" and "pen_down". Again, for the readers of this blog, it probably seems very simple. However, I understand that this is something that has to be explained to learners (especially the younger ones), as it does not have an immediate analogy in their experience. I would argue that a more natural set of commands would be something like "start_drawing()" and "stop_drawing()". This could then later be expanded to something like "start_drawing(color=red)" and "start_drawing(color=red, thickness=2)". Another future expansion of rur-ple would be in a third environment, this time a 3-dimensional one (perhaps using Vpython).
I have mentioned that Logo is perhaps too limited in its ability to introduce problems requiring analytical skills. This is because Logo's traditional environment is an empty one. By contrast, rur-ple introduce a world in which obstacles (walls) can be present. One can then ask the user to solve various programs, from a simple "climbing a step" to finding a way out of a maze. This is done by introducing, one keyword at a time, Python's syntax. In fact, because the full power of Python is available, one can even easily use rur-ple to program a visual solution to the Tower of Hanoi problem!
This brings me to my final, and perhaps most important point. If one is to design a curriculum making use of technological tools to introduce mathematical and analytical skills, the focus should be on coming up with a coherent and progressive set of problems to be given to the students. The main idea should be to use the technological tools to solve the problems and learn about them, rather than using the problems to learn about the technological tools. I have to admit that rur-ple's lessons so far have been written in the second way: problems are introduced as a motivation to learn about computer programming (i.e. a technological tool). Perhaps the result of the Shuttleworth Summit will influence future lessons that will be included with rur-ple!
Saturday, March 04, 2006
Lightning Compiler and RUR-PLE update
RUR-PLE has changed internally quite a bit. I now use ".po" files for string translations instead of the idiosyncratic approach I was using. Previously I added a python file for each language, containing a series of variable assignements like:
USER_STOP = "You stopped me!"
or
USER_STOP = "Vous m'avez arrêté!"
and I would invoke the strings through something like translation.USER_STOP.
Now, I use the same method as the gettext approach, i.e. something like
_("You stopped me!")
with the translations stored in .po files. More than 100 strings had to be changed in some 14 different files. Other "minor" changes had to be made as well... all very tedious, but it seems to be working ok. I wrote my own ".po" interpreter instead of compiling the files to ".mo" format and using gettext, as this seems to give me a better control over the encoding. A similar project (Guido van Robot) is using gettext and baffling encoding problems seem to be surfacing from time to time.
Three other significant changes were made to RUR-PLE:
1. a program can be run without being saved first. This was inspired from reading a post by Ted Leung
2. The dialog that appears after a successful run now disappears on its own after two seconds, instead of requiring the user to click a button. This was suggested in a comment left on this blog.
3. The embedded Python editor has been replaced by Lightning Compiler. I had to draw a whole bunch of images to use for the buttons; artwork is not exactly my forte, but it will have to do for now. A consequence of this new embedding has been a more consistent choice of color used in the embedded Python interpreter as well; the same basic coloring is used in the Python editor, the "robot editor" and the interpreter.
Unfortunately, I had to write new strings... which are neither translated in Spanish (help!) nor in French (my own laziness).
I am seriously considering embedding a turtle graphics page within the app; this would be using the same format as the robot world page: an editor on the left, a canvas on the right, and the program is executed by clicking on a button. However, this is a major change and will probably have to wait after version 1.0 has been released (RUR-PLE is at 0.9.7 currently!). I will soon have to learn about using setup.py, pyexe and inno installer, as version 1.0 probably should be a one click install affair. I might have to learn how to install it in a multi-user environment, with some common directory for the basic app and separate directories for each user-written programs... Suggestions as to the best way to do that are more than welcome!
Monday, February 20, 2006
Python wish: a new meaning for "import ... as ..."
if __name__ == "__main__":
block of code.
However, if the module is also meant to possibly be used by itself, then this approach doesn't work and the testing code has to be put in a separate module. I wish it would be possible to write something like
if __name__ == ''SomeNameChosenForTestingPurpose":
inside this_module.py and that importing the module using
import this_module as SomeNameChosenForTestingPurpose
would result in the variable __name__ inside this_module.py being assigned to SomeNameChosenForTestingPurpose. This would allow the inclusion of the testing code to be always kept inside a given Python module. To build a test suite, one would only need to have a module that does a series of "import ... as ..." statements.
As it is, __name__ is either equal to "__main__" or the original name of the Python file (this_module in the example above).
===In short, I would like to be able to design Python modules in this way:
some clever Python code
if __name__ == "__main__":
some clever Python code to be
executed when this module
is called as the main program.
if __name__ == "SomeNameChosenForTestingPurpose":
Some clever Python code
to be executed when
this module is imported as
SomeNameChosenForTestingPurpose
Sunday, February 12, 2006
Was rur-ple broken for Linux?
Lightning 1.7 released
One thing I have noticed is that scripts that contain encoding information give a run-time error. It is thus necessary to remove the encoding information (a line like # -*- encoding: latin-1 -*-) prior to running the script. If anyone knows of a different workaround, I'd appreciate hearing about it.
Lightning 1.6 released
The code has also been refactored so that it should be possible to customize various display options (default window sizes and fonts primarily) without having to understand how the rest of the program is structured.
Planned for the next release is the ability to simulate running a program with an argument list.
Saturday, February 11, 2006
Lightning compiler: drag and drop option
Feel free to suggest other useful options. :-)
Wednesday, February 08, 2006
A question of design (Lightning 1.4)
Lightning Compiler was originally meant as a teaching tool embedded in rur-ple. As such, it was very simple by design. Since I "extracted" it from rur-ple to become a stand-alone tool, I have been faced with the temptation of adding various features (creeping featuritis?), following users' comments (3!), especially when they had themselves made some modifications that they found useful.
I don't want Lightning Compiler to become a bloated app. ;-) Actually, as anybody that has looked at it would know, there is very little danger of this happening anytime soon - at least, by the usual understanding of what a bloated app is. Still, I want to keep it simple and true to its orginal purpose. I would be very interested in hearing about other programmers' comments on my thoughts on the issue of design of an app like Lightning Compiler (L.C. for short), especially given my relative lack of experience on the subject. To provide a starting point to the discussion, here are a few thoughts on the subject.
- L.C. is meant as a "quick and dirty" little app, useful to test some programs, usually short ones but that would be too long to type (and re-type) at the interpreter prompt. The idea is: type a program, press a button to execute, look at the output; make some changes and repeat the process.
- L.C. is meant to add a "nice" user interface for input() and raw_input() commands when needed. This is its one "unique" feature as far as I know.
- L.C. can also be use to run (and modify, and run again...) longer programs obtained from elsewhere - like, for instance, the Python Cookbook. The idea is to be able to cut-and-paste a code sample and run it with as little fuss as possible.
- L.C. should be as simple as possible to be useful to do this - but no simpler.
- L.C. is a gui app that is meant to be lauched either from a terminal window or (under Windows XP, which I use - sorry to Linux and Mac users;-) by double-clicking on it. Still, I keep a terminal window present so that error messages from running L.C. itself can be read and captured. (This was especially useful in the original writing of L.C.)
- L.C has two basic windows: an editor window and an output window; print and error statements are redirected to the output window when running a program (and redirected back to the default terminal window afterwards, so that error messages from running L.C. are captured separately).
- L.C. has no menus, only buttons. Each option/operation is thus meant to be always visible at all time. Since nothing is hidden, the number of options has to be small ;-)
- L.C.'s buttons are simple labeled buttons (no fancy image); the idea is to keep it in a single file, as small as possible.
- Button labels are only in English. Well, this is of course easily changed by an individual programmer; this is a programmer's tool after all.
- Each action that can be performed by pressing a button can also be performed by a key combination. This is to allow "power users" to use it without their hands leaving the keyboard. From what I have read, this is considered nearly essential by *nix power users ;-)
- Possibility to hide the output window, giving more space to the editing window (to see more code at once); when hiding the output window, the amount of screen-space it occupies (after possible adjustment by the user) is remembered.
- Focus in the editor window at the start; ready to type and run :-)
- Default size of output window just large enough that all "help text" can be displayed at once in it... but no longer.
- Access to the interpreter, through a tabbed interface. This should be especially useful for finding information about modules with dir() or help()
- (New) If some text is selected, only that text is executed - but a warning is added in the output window ... especially in case the selected text is not visible in the Editor window because of scrolling...
- (New) Go to line number feature; should be useful when an error message is seen in the output window.
- The text from the output window is NOT cleared each time a new program execution (run) occurs; I know that one user changed that default so that his output window is cleared each time. My reasoning is that a user should be able to run the program, change a parameter, run it again, and be able to compare the results of each run. It is easy enough to clear the output after all (ctrl-l or pressing a button).
- No "find" feature. I've debated about this one... I looked at the wxPython demo and realised that, to do this properly requires more than a few lines of code... Furthermore, if one runs a program and gets an error message, only the line number (with the new "go to" feature) is really needed. I'm still debating...
- NO find-and-replace feature. This is something that is useful in a full-fledge editor or IDE, but seems to be an overkill for an app of this kind.
- Open and save file; this should be self-explanatory. No "save as"; can be easily done within save - actually "save" is really a "save as". ;-)
- Help button; just as a reminder that it is available.
- L.C. has no provisions for running programs that expect some arguments. I believe that if this can not be simulated with an added "if __name__ == '__main__" block, then you should use a different tool to work with.
Tuesday, February 07, 2006
Lightning 1.3: yet, one more!
Wouldn't it be nice to see to try to import this module and use dir() and help() to find out ...Then I realised that it would be silly to use Lightning Compiler :-) to do so; this was clearly a task better left for the interpreter. Then it dawned on me...
Version 1.3 is out. I changed the layout to use a wxNotebook, with the first page being the same Python Editor as before, and the second page is an embedded Python Interpreter, for those rare occasions when you just need it. All this, under 20kb (of course, using wxPython to do the heavy work), and it still loads in less than a second on my computer.
Of course, for the really heavy work, I still use SPE...
P.S. Remember that the Editor handles input() and raw_input() much better than the Interpreter does! ;-)
Lightning 1.2: yet, another new version!
Feel free to make more suggestions! As long as it doesn't bloat the program, and that I see some use for them... I'll make the changes to this toy app.
Now, for something somewhat unrelated... I had posted a simplified version on the online Python Cookbook. Now, because of new additions, it no longer longer appears on the front page, and will probably never be commented on again. [After all, who would think of looking for such a little app in the Python Cookbook.] But, just for fun, if you find Lightning Compiler useful, why don't you go to the online Python Cookbook and give it a rating. It would be kind of fun if it turned out to be the most often rated recipe ;-)
Monday, February 06, 2006
lightning 1.1: new and improved
====Infomercial====
Are you tired of retyping some complicated indented code at the interpreter prompt?
Do you get annoyed with mixed tabs and spaces?
Do you find it troublesome having to start a full-fledge IDE just to test a few lines of code?
With Lightning Compiler, you don't have to!
Lightning Compiler allows you to open files and save them, or simply type in your Python code from scratch just like a more expensive editor. However, unlike these complicated programs, Lightning Compiler also allows you to test your code instantly, at the click of a button.
The new and improved Lightning Compiler even allows you to do all this without even having to use a mouse: you can control it entirely from your keyboard, just like the Unix gurus!
But wait, there's more!
If you download Lightning Compiler right now, we'll throw in a source colorizer in the editing window absolutely free. With the source colorizer, you will never make a typo in a Python keyword as you edit your code. In addition, we'll include a tab-to-4 space automatic conversion.
And that's not all... Lightning Compiler runs on all major platforms.
So, what are you waiting for? You can download Lightning Compiler right now!
Mirrors are standing by!
Lightning compiler is provided as is, with no guarantee. Possible side-effects include: carpal tunnel syndrome, cross eyes, sore neck, and general lack of social life. Python (and its batteries) and wxPython not included.
======End of Infomercial=====
I always wanted to do a fake infomercial... Now that it's done...
In the past week, I was looking at the stats on download for rur-ple, following the latest release of the lessons and of rur-ple itself, and noticed a fairly large increase. I felt good about that, given all the time I spent on it. Then, I noticed that I could look at individual stats for all the "packages". Much to my surprise, "Lightning Compiler" was responsible for a significant part of the increase in downloads. Not bad for just a little app that was extracted from rur-ple! I even got just about as much feedback (two comments in a week!) on it than I got for rur-ple in about a year. When I first released it, I gave it a version number 1.0, even though it was not very polished. I thought I was done with it as it was answering my needs as a small one-purpose tool. However, as a result of the comments I got, I made some changes to Lightning Compiler, and produced a version 1.1!
For those that don't know about Lightning Compiler, it is a simple windowed app: one window is a Python editor, the other an output window. Your can run your code, and watch the result in the output window, with input() and raw_input() handled through dialogs (wxPython based).
It is not meant to be a "serious" app, but I find I use it more and more, and almost never use the Python interpreter anymore!
Friday, February 03, 2006
Fixing Reeborg: introducing classes
- I used the analogy of synonyms to talk about variables
- Students have already seen how to define new object [like Reeborg = UsedRobot()]
Fixing up Reeborg
As we have seen, we can create new robots by using the notation
Reeborg = UsedRobot()
Erdna = UsedRobot(2, 2)
However, these robots are just like the original nameless one: they
can only turn left. To teach them how to turn right, we could define
a function similar to what we did before:
def Reeborg_turn_right():
for i in range(3):
Reeborg.turn_left()
However, there are at least two problems with this approach:
We need to define a similar function for every single robot we create (Reeborg, Erdna, ...).
Reeborg and turn are separated by an underscore character "_" for the function we defined [to turn right] and by a dot "." for the built-in method [to turn left]. This would not look right...
A better approach is to define a new class that would inherit from the class UsedRobot. This is
what we do in the next section.
I will show you first how we can fix our robot so that it knows how to turn right, and explain what I did afterwords.
class RepairedRobot(UsedRobot):
def turn_right(synonym_used_to_refer_to_this_object):
for i in range(3):
synonym_used_to_refer_to_this_object.turn_left()
Here's how we can then use this new class of objects:
newReeborg = RepairedRobot()
newErdna = RepairedRobot(2, 2)
newReeborg.turn_left() # as before
newReeborg.turn_right() # new method!
newErdna.turn_right() # this one works too!
And now, it is time to explain. The Python keyword class indicates that we are going to define a new type of "function", one that creates objects. What follows class is: RepairedRobot(UsedRobot).
RepairedRobot is the name of our new class; by writing UsedRobot between the parentheses, we ensure that the new class RepairedRobot inherits all the methods and attributes that UsedRobot had. Thus, when we write:
newReeborg = RepairedRobot()
we create a new robot "named" newReeborg which can do (at least all) the same things that the old Reeborg = UsedRobot() could do.
Next, inside the new class, as indicated by the indented block, we define a new method, turn_right(). By defining it inside the class, we take the first step to insure that all the robots that are created by calling RepairedRobot() will be able to turn right!The second step that is required is to tell Python that the method will "belong" to the particular object that has been created. To do so, we use the variable synonym_used_to_refer_to_this_object which will refer to newReeborg, newErdna, etc., depending on what object is created. When we write
newReeborg = RepairedRobot()
Python creates a new instance of the class RepairedRobot and defines all the methods, replacing the first argument of the method (synonym_used_to_refer_to_this_object) by the name of the
instance (newReeborg).
Now, synonym_used_to_refer_to_this_object is rather a long name to type. By convention, another variable name is used: self. Thus, to follow the normal convention, I should have
written:
class RepairedRobot(UsedRobot):
def turn_right(self):
for i in range(3):
self.turn_left()
Tuesday, January 31, 2006
Showcasing Python: rur-ple on the web?
I was intrigued with the idea of a "Try Python" web site that I read about recently. Inspired by an idea originally mentioned by Steve Howell to create Webster van Robot, a web version of Guido van Robot (which itself was the inspiration for rur-ple) I have been wondering about the possibility of creating a version of rur-ple (only Reeborg's world part) that would run in a standard browser, just like one can use "Try Python".
There are two versions of "Try Python": Mike Meyer's, and Devan Lai's. While Devan (a very promising 14 year old programmer, imho) in a post on comp.lang.python wrote that Meyer's is the "cooler" implementation of the two, I personnally think that Devan's is the cooler of the two, and the one with the best potential for showcasing rur-ple as his version can already accept function definitions (and probably more; I just had a very quick look at both).
Now, I know very little about web stuff. One thing I know is that, for "games" type object, it is
Now, I think that, if having a version of rur-ple on the web were to be done, it could generate a lot more attention on Python, and on the web framework that would have been used to develop it if using one of those fancy web frameworks is required.
Nonetheless, if one was to really showcase Python using rur-ple on the web, I think the following requirements would have to be satisfied:
- It should not require the user to install a plugin in his/her browser, just like it is done with the "Try Python" sites;
- it should not require a special browser, like Grail, either;
- it should not require some fancy javascript, but only html and css - remember, it is Python we want to showcase; along the same lines, it should not be implemented via a Python applet. Using Jython would be almost like cheating, imho.
Can this be done using one of these famous web frameworks that are generating so many discussions, including the one spurred by Python's bdfl? I personnally have no idea... One thing I know for sure: if it is, I will have to do some major refactoring of my code as the gui stuff is too much intertwined with the logic part; I had no concept of the model-view-controller approach when I started creating rur-ple, and I had no clear reason to try to conform to it (if it ain't broke...) later on. But, given a strong enough incentive, I could always do it!
Monday, January 30, 2006
Rur-ple 0.95 is out
This new version has required a lot of work, and relatively little to show for, for the casual observer. Other than writing more lessons, there are still a few things that I must implement before release 1.0. There has been a comment made on this blog about eliminating the "Success" dialog. The person who made the comment had a very good point. However, I have read a fair bit about "positive visual reinforcement" as an encouragement to programmers; even experience programmers seem to get motivated by it (think "green lights/red lights" for Java unit testers ... if you're familiar with it). So, I have been thinking about some alternative that don't require the user to actually press a button to resume.
This newest release has what I consider to be a really nifty feature; I call it the Lightning Compiler. This is a cross between a Python editor and a Python interpreter. It is a GUI based app with two main windows. Just enter a script, either by typing it in or importing from a file, in the Editor window, press "run", and you get the result in the output window. It handles input() and raw_input() through dialogs. I like it so much, that I submitted a simplified version to the online Python cookbook. It is available as a separate download (lightning.py) on sourceforge. I now use it as my lightweight basic Python testing environment. I still use SPE for serious coding though. If you haven't tried it yet, I strongly encourage you to do so.
[The lightning compiler is embedded in rur-ple in the fourth tab, and the interface is a bit different from the stand-alone version. It should be more user-friendly looking for a younger audience.]
=============================
RUR-PLE 0.95 has been released.
A link to the download page can be found at http://rur-ple.sourceforge.net
(The site is slightly out of date, and there is no plan to update it in the future as it provides an excellent idea of what RUR-PLE is about.)
This new version contains a few bug fixes and it should now work properly on MacOS. wxPython 2.6+ is strongly recommmended. There has been a few minor changes in the robot instructions, and the lessons has undergone some major changes.
RUR-PLE stands for Roberge's Used Robot: a Python Learning Environment.
This learning environment contains four main elements:
1. A simple html browser to look at the documentation and, potentially, the lessons. However, the new lessons use cascading style sheets which cannot be interpreted correctly by the browser. Usage of an external browser (Firefox :-) is strongly recommended.
2. A "robot world" with a robot that can accomplish tasks through Python programs.
3. A built-in interpreter which can be used to play with Python
4. A built-in file editor which can be used for futher Python explorations.
The interface is available in English, French and Spanish. Translations are welcome!
Version 0.95 contains 36 complete lessons (English version only). The lessons are also available as a separate download.
Version 1.0, which will aim to be a "complete" Python tutorial for people that have never programmed before, should have approximately 50 lessons.
A few "bonus" lessons have been included. In particular, it is suggested that you have a look at "A Robotic Fairy Tale".
=====
In 1981, Richard Pattis introduced "Karel the Robot" as a tool to teach computer programming.
Reeborg is a robot built on the 1981 Pattis' model... and it is starting to show its age.
It has an oil leak, which allows us to follow its trail. Its compass is broken; it only knows if it is
facing north or not, unlike Karel who could determine its orientation with respect to all four cardinal points.
Pattis' Karel the Robot was named after the author Karel Capek, who popularized the word robot in his play Rossum's Universal Robots (RUR). While RUR-PLE shares the basic RUR acronym,
in this case it stands for Roberge's Used Robot. However, through the magic of Guido van Rossum's Python, you can learn how to fix it and design a better one, worthy of the name Rossum's Universal Robot.
Sunday, January 29, 2006
First separate release of rur-ple lessons
Next, I will have to do an application release, with various bug fixes...
Saturday, January 28, 2006
Foxit pdf reader: fast!
Friday, January 27, 2006
Rur-ple: time to drop the browser?
This would have the added benefits that 1) I could do separate releases for the lessons and the main app, and 2) I could start adding "fancy css tricks" to make the lessons even more visually interesting.
In addition to dropping the browser, I have had to modify the "python editor" window so that programs are not run from it using "exec", as I found out that one cannot make use of "raw_input()" in code that's run by exec or other family members. I have had to embed a second python shell and programs are now run via an import/reload done at the push of a button. I looked briefly at how Idle runs programs, but it was rather convoluted and didn't seem worth the effort to implement. Perhaps someone reading this will have a better idea... [I have not looked yet at the possibility of using popen(), which I have never used, but is apparently used by Makebot; Makebot seems to be doing exactly what I would like to do.].
I'm almost ready for a new release (0.9.5?) of rur-ple, which should now work under MacOS (as well as Windows and Linux). The new release should include about 40 lessons; 10 more lessons or so and it will be finally release 1.0; next will be an introduction to designing games with Pygames!
Reading about browsers, I found out that 20% of users still use screen sizes of 800x600 only. Rur-ple's interface has grown so that it currently needs at least 900x700 for sub-windows to be displayed in a large enough size to be fully useful. One solution might be to reduce the button sizes; however I am afraid that they would become too small at much larger screen sizes. Of course, a way out would be to have multiple image sizes for the buttons, depending on the screen size ... but that somehow seems excessive. I wonder what Joel would think of this.
Thursday, January 19, 2006
Rant!
Now, Rur-ple is always described as a fun way to teach programming to children. Nothing serious about that.
Granted, the lessons included so far (save for a few incomplete examples) do not touch "important modern programming concepts, like objects, and polymorphism." And granted that I wrote the lessons so that even children could learn programming by using Rur-ple; I even made some comments about this fact. It is (only) possible to do so because Python is used (instead of C++ or Java).
I guess I will have to wait until I finish writing the first 50 lessons or so before I can have people notice that Rur-ple could perhaps be taken more seriously by older children.
That's my rant for 2006!