Python Programming, news on the Voidspace Python Projects and all things techie.
Movable Python for Python 2.2 & Tkinter Functional Testing (or the lack thereof)
To obtain it see :
This means that there are now Movable Python distributions available for Python 2.2 - 2.5. This latest version is 2.0.0 alpha 2. In the process of getting the 2.2 distribution to work  I uncovered two bugs in the new code. They both related to Quick Launch Buttons and are now fixed. If you have downloaded a new version, it is worth grabbing an update. You can copy your config files (from the lib/config directory) to not lose anything you have setup.
The new Movable Python does a lot more than the previous version, but the GUI is basically untested. This is because I couldn't find an Open Source functional testing suite for Tkinter. In fact the only functional test suite I could find for Tk was Squish by Froglogic, which is more oriented towards Tk/Tcl. Despite the cute name it has an inversely cute price tag attached.
Once Movable Python has hit 2.0.0 final I will probably build a functional test suite based on PyUnitGui. Having complete functional test coverage is a pain to backport to an existing project, but not only makes for a more solid project, it is a much nicer experience to able to add code or refactor in confidence that you aren't breaking anything. This actually happened with Movable Python 1 (the last two updates broke part of the config file handling), and I'm determined to prevent it in the future.
Meanwhile, it is going to take me a few more weeks to update the Movable Python documentation. During this time Movable Python will move through alpha-beta-release candidate phases, squashing bugs and adding features as we go.
|||And wrestling with Pmw and Pywin32 for Python 2.2...|
Movable Python for Python 2.5
To obtain it see :
When building the 2.5 distribution I found that the interactive interpreter would crash when built against Python 2.5 beta2  (although IDLE and Pythonwin both work). For this reason there are two distributions in the group, one built with Python 2.5b1 and one with Python 2.5b2. These are both created using the new Movable Python 2.0.0 alpha 1.
Whilst Python 2.5 is not yet a final release, the cost is lower than the other distributions, a snip at £3.99.
If you buy now you will still be entitled to all future upgrades for a year.
The Python 2.5 distributions, as well as the full standard library, include :
- Pywin32 build 209
- wxPython 184.108.40.206
- Various other pure Python modules like docutils, pythonutils, and Pmw
Some of the 'impure' extensions normally included with Movable Python, like Pycrypto, don't yet have 2.5 binaries and so couldn't be included. These will be added as soon as binaries are available .
As well as many additions to the standard library, Python 2.5 introduces several important changes to the core language. See What's New in Python for a full list. Movable Python provides a useful way of testing your programs for compatibility with Python 2.5.
When testing some of my code I found two minor points I needed to change
- I got a warning that with would soon become a reserved keyword
- Although from __future__ ... statements have always been documented as needing to be the first statement in a module, this wasn't enforced until Python 2.5
Movable Python hasn't yet been tested extensively with the new standard library additions, so changes and fixes may be needed. Feedback welcomed !
|||This appears to be because of an incompatibility between py2exe 0.6.5 and Python 2.5b2.|
|||I've just noticed that PIL does have a binary available. This will be added soon.|
My First Employee, Why Selling Doesn't Work Anymore & Evolutionary Programming
This afternoon I spent an enjoyable time with my Dad attending a lecture on Why Selling Doesn't Work Anymore, by Grant Leboff.
It was mostly an excuse to spend some time with my Dad. On the way to the lecture I joked with my Dad about taking him on as an employee at Voidspace to take advantage of cheap software licenses I can get. When we got to the lecture we found that, because I had registered first, they had assumed he was also a part of Voidspace, maybe this bodes well for the future...
I don't do sales, so I didn't expect the lecture to be very useful, but the title was very provocative so I hoped it would at least be interesting. The subtitles for the lecture included :
- Never give a sales presentation
- Open and Closed Questions: the model is wrong
- Never sell the Benefits
- Don't handle objections
- Never try to close a deal
It was a well delivered talk (Grant is an engaging guy), with some interesting points. Perhaps not revolutionary but certainly worth listening to.
His basic point is that the hard sell sales model doesn't work and that a relational model is much more effective.
If you do a sales presentation, and sell your product on its benefits, then it's going to sound like a sales pitch full of platitudes; just like every other sales pitch from your competitors.
Instead you need to listen to your customers, give them the opportunity to talk, and work out what their problem is. If you help them find a solution to their problem then they will ask you what the next step is, instead of you having to close the deal.
If you do a sales pitch and then handle the objections then you are setting up an adversarial situation, even if you win the argument you will lose the sale. Additionally you need to be aware that humans are fundamentally risk-averse. This is why the IBM advert no one ever got fired for buying IBM was effective . If you are proposing change, you need to take the risk out, one example is money back offers which people rarely take up but feel secure if they know is available to them.
Anyway, this is a hurried summary; so don't judge Grant's presentation on the basis of it. I enjoyed it though.
Before the talk started I was discussing extreme programming software development techniques with my Dad. He runs a business called 4-Sight Consulting, which he started with a partner about fourteen years ago . They specialise in engineering services related to functional (or technical) safety and reliability, particularly for heavy industry. He was programming in Fortran, on real computers before I was born (and later Ada).
He is interested in pair programming which was new to him , but iterative programming wasn't new. It has existed for a long time, but was known as evolutionary programming. The drawback with evolutionary programming was that program architecture resulting from projects using this could be horrible. A way round this was to combine evolutionary programming with an up-front architecture design.
At Resolver we are no strangers to having to maintain an overview of our architecture. Some of the major user stories we have tackled in recent iterations have caused relatively dramatic changes to our object model. Major refactors are tricky, but not dramatically painful though. Another aspect of extreme programming is TDD: Test Driven Development. We have full unit test and functional test coverage. When we embark on a refactor, we work on a module at a time, getting the unit tests to pass again. We know when we have restored everything when all the tests pass again. My Dad was impressed, evolutionary architecture.
|||And famously amongst my readership, why Java continues to succeed as a development platform...|
|||When I get time I will post a paper by my father on realistic password security policies.|
|||But sounds like a good idea as in his code needed to be reviewed by another programmer before it could be integrated.|
Movable Python 2 for Python 2.3
This is of course free to those who have already paid for the 2.3 distribution.
Distributions for Python 2.2 and Python 2.5 will follow shortly, after which I will be creating a Mega-Bundle  with all the distributions bundled together. The interface will be pre-configured so you can test programs with all the versions of Python from one interface.
There will also soon (hopefully) be drag-and-drop support in Movable Python, thanks to Michael Lange who has updated TkinterDnD for tkDnD2.
|||Anyone got a suggestion for a better name ?|
Akismet Module 0.1.3
There has been a slight update to my Akismet Python Module.
This is a bugfix thanks to James Bennett who pointed out that it didn't pass on a piece of information (the blog url) required by Akismet. Bizarre, it used to work
Anyway, it's now fixed and the Demo CGI works again.
You can download the updated module from :
For those who don't know, Akismet is a web service that tells you whether comments posted to blogs are spam or ham. This module is a Python interface to the service.
Movable Python 2.0.0 alpha 1
I am pleased to announce that (finally) there is a version of Movable Python 2 out in the wild. As usual it took longer than estimated , but it is now available for download and testing.
This updated version has lots of new features, and is a lot more useful than the previous versions. Once I have built distributions for the 'other' Python versions you will be able to test programs with all versions of Python from a single interface. As it is you can setup any executable as an 'interpreter' and use the Movpy launcher to run programs, including passing command line arguments.
Be warned though, this is an alpha release and the docs are not yet updated. Please report any bugs and oddnesses to me.
To obtain it visit :
Those who have already paid for Movable Python for Python 2.4 will already have free access to it.
What is Movable Python ?
Movable Python is a distribution of Python, for windows, that can run without being installed. It means you can carry a full development environment round on a USB stick.
It is also useful for testing programs with a 'clean Python install', and testing programs with multiple versions of Python.
The GUI program launcher makes it a useful programmers tool, including features like :
- Log the output of all Python scripts run
- Enable Psyco for all scripts
- Quick Launch buttons for commonly used programs
- Configure multiple interpreters for use from a single interface
Plus many other features and bundled libraries.
What's New ?
The changes in version 2 include :
- Added menus.
- Added logging.
- The IDE is now configurable.
- Pythonwin is the default IDE and bundled with Movable Python.
- Eight configurable quick launch buttons instead of 4, with a simpler configuration dialog.
- Improved the command line option configuration dialog.
- The interpreter used to run files can be chosen. (Including programs other than Python interpreters.) 
- An installed version of Python can be detected and registered as an interpreter.
- You can 'choose' files as well as launching them. These can be launched by hitting enter in the entry box. Previous files can be chosen from a drop down list.
- Console handling - now follows .py/.pyw but can be overridden (you can force a console for '.py' files and vice-versa).
- You can configure the working directory scripts are run in.
- Escape bound to exit in the main GUI.
- Calltips for icons.
- Bound an explanation tooltip in the quick launch and interpreter dialogs to the labels
- A nifty new about window.
- Disabled quick launch buttons without an action.
- Got rid of Die option.
- initial_directory is now stored relative to movpydir rather than libdir.
- Quick Launch file paths are stored relative to the movpydir.
- All config files moved to a config directory.
- A __main__ module fix, so that unittests run.
- Fixed bug where k and koff in the config file would not be overridden by the -o option.
- Fixed bug in save and load quick launch button configuration. (Introduced in 1.0.1)
- Fixed bug in saving to and loading from "config.txt". (Introduced in 1.0.2)
There is still a long TODO list of improvements, which I will publish soon.
|||This is the story of our iteration meetings at work...|
To pass command line arguments to the interpreter program you can put the executable filename in double quotes and put command line arguments after. e.g. '"c:\Path\something.exe" -option'.
Python files can be used as an interpreter - in which case they will in turn be run by the Movable Python executable.
More Python News
I went a whole week without posting.
I wasn't on vacation, instead I've been pouring my spare time into working on Movable Python. Hopefully I will be able to upload and announce an alpha version tonight for people to play with. The changes, which are many, should make Movable Python a much more useful tool.
In the meantime, the world of Python hasn't stood still. I have several posts waiting in the wings, and a few articles that need editing. Along with this various things of note have happened. The ones that caught my eye include :
We're getting closer to the final release of Python 2.5. This has lots of additions and changes over Python 2.4. There are some very notable additions to the standard library as well as core language changes.
Another fine release from the IronPython team. 'Upgrading' Resolver to this release was trivially simple, and it fixed a couple of minor issues we had.
Interestingly, now that they are getting closer to the full Python spec for obscure details like the exact order that object attributes are looked up, performance is turning out to be closer to CPython than previously. Python performance seems to be much more dependent on its dynamic features than the underlying platform. After getting 1.0 final out, the team will start looking at performance and tweaking things.
For those interested in IronPython there is a very good article on devsource. It is called A First Look at IronPython: Where Python meets .NET, and is a good introduction to both Python and IronPython. It's getting a lot of love on Del.icio.us, so hopefully new people are exploring Python because of IronPython.
Another major project to see an update in the last few days is wxPython. There are also Python 2.5 binaries now, so I will be able to include it in the Python 2.5 distribution of Movable Python...
This work is licensed under a Creative Commons Attribution-Share Alike 2.0 License.