Saturday, January 28, 2006
Foxit pdf reader: fast!
This post is not about Python, contrary to this blog's purpose - but I just had to write about Foxit pdf reader . It is fast. Incredibly fast compared with Adobe's Reader. When it is set as the system's default browser, it can be used with Firefox (just do Tools -> Options -> Downloads -> Plugins -> disable viewing PDF files with plugin). The only drawback I can see is that it is a Windows only product. You can even type in your own text on a page prior to printing.
Friday, January 27, 2006
Rur-ple: time to drop the browser?
After spending some time writing my python tutorial included with rur-ple in html+css, I have started getting even more annoyed with the simple html browser included with wxPython. I am thinking of dropping it altogether (or perhaps only use it to display some introductory message) and require the use of a standard browser to read the lessons in a separate window. While I have written a simple program that does the html+css -> simple html conversion, it is rather tedious to have to do this, lesson by lesson, every time I update a lesson. Of course, I could change it to process files in batch I suppose, but I'm not sure it's worth the effort.
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.
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!
Google "Karel Robot", and have a look at the results: web pages about how a Java or C++ version of "Karel the Robot" can be used to teach (parts of) a first year university level in computer science. You'll find explanations on how important programming concepts can be taught using modern paradigms, object-oriented and polymorphism. All serious stuff.
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!
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!
Tuesday, January 17, 2006
Rur-ple update
As the few readers of this blog know, my programming work had stalled for a few months. However, I have resumed work on rur-ple over the last few weeks and some good news should come out soon.
I have revised all existing lessons and changed from using hard-coded html information (like font-colors and such) to using cascading style sheets. This will give me more freedom in trying various visual designs for the lessons. However, since rur-ple makes use of wxPython and that its browser uses wxHtml which does not recognize style sheets ... I had to write a converter that would take an xHtml file with the associated .css and convert into plain Html. This work has taken a few (long) nights to complete but it is now essentially done; I can finally resume writing new lessons.
While revising the existing lessons, I wrote my own solutions to all suggested exercises. This lead to some reorganisation of the material, some new minor additions and, more importantly, some deletions of less pedagogical examples.
I have also received some feedback (bugs report!) from a MacOS user. I had to make a few changes to the basic code and it should now be more robust on all platforms. Unfortunately, this also lead me to change the default size on opening to 900x660; I just hope that this relatively large size (greater than 800x600) will not create problems for prospective users.
The lessons are now divided in 5 parts:
Finally, as some users have suggested, I might investigate the possibility of turning the lessons into a book. However, I should probably get some more feedback from users before attempting to do so.
I have revised all existing lessons and changed from using hard-coded html information (like font-colors and such) to using cascading style sheets. This will give me more freedom in trying various visual designs for the lessons. However, since rur-ple makes use of wxPython and that its browser uses wxHtml which does not recognize style sheets ... I had to write a converter that would take an xHtml file with the associated .css and convert into plain Html. This work has taken a few (long) nights to complete but it is now essentially done; I can finally resume writing new lessons.
While revising the existing lessons, I wrote my own solutions to all suggested exercises. This lead to some reorganisation of the material, some new minor additions and, more importantly, some deletions of less pedagogical examples.
I have also received some feedback (bugs report!) from a MacOS user. I had to make a few changes to the basic code and it should now be more robust on all platforms. Unfortunately, this also lead me to change the default size on opening to 900x660; I just hope that this relatively large size (greater than 800x600) will not create problems for prospective users.
The lessons are now divided in 5 parts:
- Welcome to Reeborg's world. This includes 9 lessons and introduce various robot commands.
- Reeborg knows Python. 15 lessons, which include an introduction to the following Python keywords: def, if, else, elif, while, not, pass. Notions of "True" and "False" are also introduced.
- Python the interpreter. This will be more akin to a "standard" introduction to Python, although with some side-excursion back into Reeborg's world. I have written a few lessons but they will need some polishing. There should be about 10-15 lessons in total covering numbers, strings, tuples, lists, dicts as well as the following keywords: print, for, in, from, import, return, and the pseudo-keyword "as". Variable assignment is also going to be covered in this part.
- Learning about objects. This will include lessons going back and forth between "typical" Python examples and examples in Reeborg's world. I have written four lessons and plan for about a dozen. These lessons have been the most fun to write - hopefully, they will be fun to read as well.
- Making games with Pygame. I got sidetracked with learning about Pygame a few months ago. I have some first drafts of 7 lessons which were originally written independently of rur-ple and that I will have to integrate in it. I am planning to have about 20 simple lessons that will eventually lead to some separate lessons on "major projects".
Finally, as some users have suggested, I might investigate the possibility of turning the lessons into a book. However, I should probably get some more feedback from users before attempting to do so.
Saturday, January 07, 2006
Note to self: about site customization
This post is probably of no interest to anyone but myself. I just installed Python on a new Windows XP (English), with André as my usual user name and SPE wouldn't work, due to some encoding error. The solution (which I only found in Python in a Nutshell - and only because I vaguely remembered what to look for [other Python books did not cover that topic :-( ] ) was to create a file name sitecustomize in Lib with the following:
I have to remember this...
import sys
sys.setdefaultencoding('iso-8859-1')
I have to remember this...
Friday, January 06, 2006
117 Outdone by a reader!
Markus Schramm from Germany has left a comment on my post Journey to 117 showing how one could shave yet one more character from the 117 character solution to the PyContest challenge. So, 116 it is!
Wednesday, January 04, 2006
css, wxHtmlWindow and going back to RUR-PLE
About a month ago, my second computer (actually, my main computer as the kids had taken over the better one) died. I had saved the hard-drive and managed tonight to recover the data on it. I found the beginning of a "standard" tutorial (in French) that I had started to write so that my kids could learn Python. That was in August 2004. Shortly afterwards, I discovered Guido van Robot and got inspired to create RUR-PLE. I worked fairly steady on it for a year and then, somehow, haven't been able to find the time to work on it for the past few months.
While I have been quite please with RUR-PLE in general, I have found one thing less than satisfactory: RUR-PLE uses wxPython and wxHtmlWindow to display its tutorial.
Unfortunately, wxHtmlWindow does not support style sheets, but only simple html tags. My French tutorial made use of all kinds of css tricks in an attempt to have a pleasant look. I had to gave that up and hard-code font information in the tutorial that has been included with RUR-PLE.
I have found the result with wxHtmlWindow and hard-coded fonts to be somewhat disappointing. So, today I decided that I had to try and implement some work-around so that at least I could use style-sheets to colorize the source code and headings. I have made some limited progress and I hope to have something working soon, so that I can 1. change the existing lessons so that they use some (limited) styles instead of hard-coded font information, and 2. go back to writing some more lessons and get to version 1.0!
Note: I know of the existence of wxMozilla, but haven't been able to get it to work last time I tried. RUR-PLE, which is geared towards beginners (or teachers!) already require three separate installs (Python, wxPython, and itself!). I find this is already a bit much. Besides, if I haven't been able to get wxMozilla to work on my computer, how could I expect a complete beginner to do it?...
While I have been quite please with RUR-PLE in general, I have found one thing less than satisfactory: RUR-PLE uses wxPython and wxHtmlWindow to display its tutorial.
Unfortunately, wxHtmlWindow does not support style sheets, but only simple html tags. My French tutorial made use of all kinds of css tricks in an attempt to have a pleasant look. I had to gave that up and hard-code font information in the tutorial that has been included with RUR-PLE.I have found the result with wxHtmlWindow and hard-coded fonts to be somewhat disappointing. So, today I decided that I had to try and implement some work-around so that at least I could use style-sheets to colorize the source code and headings. I have made some limited progress and I hope to have something working soon, so that I can 1. change the existing lessons so that they use some (limited) styles instead of hard-coded font information, and 2. go back to writing some more lessons and get to version 1.0!
Note: I know of the existence of wxMozilla, but haven't been able to get it to work last time I tried. RUR-PLE, which is geared towards beginners (or teachers!) already require three separate installs (Python, wxPython, and itself!). I find this is already a bit much. Besides, if I haven't been able to get wxMozilla to work on my computer, how could I expect a complete beginner to do it?...
Subscribe to:
Posts (Atom)