Flappy Wormy

For the BackSpace workshop, I’ve created another worksheet which is slightly easier (I think) than the Gem Gem worksheet. It simply reuses the Wormy game, to produce a Flappy Bird style game in python.

Here is a link to the worksheet.



I just remembered all about Blender.org.  I played with it a few years ago and was impressed then.  The open movies that have been made using it are great.  I remember it have a game dev. engine built into it too with Python.  Since I’m working on using Python for teaching programming, I wonder if I should suggest using Blender and Python as a ‘neato’ way to make game demos?
Hmm.. More investigation needed.

Finally got GTK+ working in NetBeans 6.5 (Python EA)

I easily managed get this to work on Windows XP but when I installed it on Windows Vista the python debugger ( JPyDbg ) wouldn’t find gtk. From within NetBeans I created a project which simply did the following;

import sys
print sys.path
import gtk

The import wouldn’t work and sys.path showed that the ‘gtk’ libs were not in the PYTHONPATH.  I have no idea why NetBeans hasn’t picked up the correct path since PYTHONPATH does have ‘gtk’ libs in it when running Python from the command line.

The solution?  From the NetBeans menus select “Tools->Python Platforms”.  Then from the dialogue box that pops up select “Python 2.5.4” or similar and “Python Path”.  Add the missing path which in my case was “c:\Python25\Lib\site-packages\gtk-2.0”

Dialogue box for PythonPath

Dialogue box for PythonPath


Best Python IDE … found :)

I’ve looked around at a few IDE’s for Python and I think I’ve settled on one.  Initially I considered Eclipse but I’ve now decided that NetBeans 6.5.1 is a much better solution for Linux (or Windows) Python development.

Installing it was easy.  I downloaded the C/C++ version of the IDE (since I didn’t plan to do any Java based stuff).  It is just over 20Mb at the NetBeans website.  Note: I did C/C++ then Python but you can simply download the IDE with Python from the Python EA (Easy Access) page.

In Thunar (on the Linpus) right-click on the Netbeans ‘.sh’ file, select properties and then permissions and chose to ‘allow file to run as a program’. Double click on the file to run it and the installation process begins.  Just click ‘Next’ in most cases.

After installing it; use the right-click menu (assuming you have it active) to run the IDE from the development area.  Once started, mine started to upgrade some modules for CVS, and so on (which is okay).  After the obligatory restart of the IDE, I simply used the Plugins menu in Tools to add Python support.  This is a Beta state module.

All is well? Unfortunately not; I tried to create a new project and this hung the IDE part way through creating files.  I tried NetBeans 6.5 Python EA on Windows Vista also and this worked a little better.  However, it wouldn’t pick up the gtk module in the debugger, even though IDLE did.  So still some problems but maybe you will have better luck.

Update: I did a fress install of the Netbeans Python EA after installing Python, GTK, Cairo & GObject and this appears to work in the debugger.

Nevertheless, there is a really useful tutorial on the NetBeans site.

I’ve also stumbled upon this amazing selection of programming tutorials!  In particular using Python development in NetBeans.   Replace ‘import glib’ in these tutorials with ‘import gobject’ throughout these tutorials.

Another alternative is the ActivePython IDE

Pyglet 1.1.3 crashes Linpus Lite

I thought I’d try out Pyglet on my Linpus Lite.  I have python 2.5.1 installed.  When I ran the tests in “tests/tests.py” it hung the computer on the 2nd test (draw two windows; one yellow, one purple)

The first time, it took 2 reboots to get Linpus working again.

I tried it a second time, just to be sure and it took 5 reboots to get Linpus working again but it had lost a lot of its settings.

Basically; I don’t think I’ll be running pyglet on Linpus again for a while!

No news is … too busy to write anything.

I’ve been busy with buying a car and sorting out a summer holiday to write anything recently but I did manage to find some time to mount my arduino and breadboard onto a piece of perspex last week.  It looks pretty neat and it means that I can wire circuits without everything falling apart.  I plan to stick some wheels and motors (from the printer) on it soon.  I don’t know what kind of battery I’ll need for those motors since they are rated for 18V.  9V (and less) does work but I guess that they’ll drain the batteries pretty quick.

Finding some wheels that will connecting to the motors is going to be fun but I’ll come up with something.

Before then, I’ll use the breadboard and arduino to do some IR tests.  I want to be able to read the codes coming from my iSobot remote control so that I can then use the arduino to program the iSobot more easily.  I know how to do all this, it is just finding the time to do it.

Over the last week, in a bid to get something starting on my tutorials for this blog, I finally settled on a version of GNU/Linux to recommend to new enthusiasts.  I’d recommend, Xubuntu .  I have an old laptop computer (Dell Inspiron 1150) that has 512Mb RAM and 2 Ghz Pentium II.  It is about 5 years old.  I installed a few different distros on it and now it is beginning to creak with the features. Ubuntu has always been easy to install, but it is a ‘friendly’ desktop.  Xubuntu is a very lightweight and fast version of this distro which is why I chose it.

The first additional packages for me to install were b43-fwcutter (because my wireless card doesn’t work otherwise), java runtime (sun-java6-jre) and then installed eric & IDLE (for Python) but maybe Eclipse would be a better alternative.  I ought to grab python-pygame (SDL bindings for Python) also as this is going to be useful for learning to program.  Lastly I grabbed the latest version of Arduino IDE , avr-gcc & avr-libc.

From this I should be able to provide enough information for the Programming of Robots and Video Games.  I said ages ago that I wanted to create my own Distro and this could be the first steps for a Beginner’s Programming Distro.

You’ve probably notice I’ve settled on Python for programming.  This isn’t because it is the best language for programming video games but it is a good interpreted & compiled language which reminds me of my BBC BASIC programming days.  It has idosyncracies that I don’t like but I fancy writing about programming before writing about C++.

Mounting an Arduino

I looked at a project that used PHP + Python + Maya + Servo (part1) and I like how neat it looks.  I need to mount my Arduino and Breadboard onto a bit of wood to tidy up my workplace.

%d bloggers like this: