Python Programming, news on the Voidspace Python Projects and all things techie.
Build FePy for Mac OS X (and problems solved)
One of the first things I've done on my shiny new Mac (I'll write up my first impressions soon) is to install Mono. Installing this is straightforward. The latest version (1.2.4) comes with FePy (IronPython Community Edition) for IronPython 1.1 alpha 1.
I've just got the latest version built (IronPython 1.1), but it required installing a few dependencies so I thought I would write up the process.
Here are the steps:
- Install Subversion
- Add svn to the path in your bash profile
- Install wget
- Install make
- Check out FePy from subversion
- Run 'IPCE/download.sh'
- Run 'IPCE/build.sh'
Fink is for installing and managing packages, and Fink Commander is a GUI front end. You must install Fink before installing Fink commander.
Next install Subversion. There is a Mac package for Subversion 1.4.4 available from Martin Ott. There is also a Finder plugin called SCPlugin which offers similar functionality to TortoiseSVN for Windows. This works fine for me. It must be installed after Subversion.
In order to build FePy you need the svn command on your path. Open the terminal and execute vi .bash_profile, and add the following line:
You then need to install wget and make. The easiest way of doing this is from FinkCommander.
Next checkout the FePy project from http://fepy.svn.sourceforge.net/svnroot/fepy/.
Again from the terminal cd into the directory you have just checked out FePy into and then cd into the IPCE directory. First execute sh download.sh. When this has finished execute sh build.sh.
This should have built ip.exe and ipw.exe into the dist directory. You run the interpreter with the command mono ip.exe. The default Mono version of IPCE is installed at /Library/Frameworks/Mono.framework/Versions/1.2.4/lib/IPCE/. You can either replace those files with the new ones or adjust the ip shell command in /Library/Frameworks/Mono.framework/Versions/1.2.4/bin/ to point to the new location.
Both the problems below (with the delete key and not being able to instantiate forms) were solved by running the IronPython interpreter from xterm instead of the normal terminal. This uses the X11 server which is provided by Apple - but needs installing separately (included on 'disk 1' of the Mac OS X install CDs).
Unfortunately the latest version still has a problem with the delete key not working in the interactive interpreter.
On top of this, I can't get Windows Forms to work with Mac OS X. Allegedly it should work, but... I do have the Apple X11 server installed (which I don't think is needed anyway).
I can add a reference to System.Windows.Forms, but when I try to instantiate a Form I get the following error:
IronPython 1.1 (1.1) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.AddReference('System.Windows.Forms') >>> from System.Windows.Forms import * >>> f = Form() Traceback (most recent call last): File System.Windows.Forms, line unknown, in .cctor File System.Windows.Forms, line unknown, in GetInstance File System.Windows.Forms, line unknown, in .ctor File System.Windows.Forms, line unknown, in SetDisplay File System.Windows.Forms, line unknown, in .ctor File System.Windows.Forms, line unknown, in .ctor File System.Windows.Forms, line unknown, in InternalSizeFromClientSize File System.Windows.Forms, line unknown, in get_CreateParams SystemError: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI >>>
The interwebz has people reporting the same problems against older versions of Mono and suggests that new entries might be needed in the config files. These entries are already present for the latest Mono package, but still no joy. Has anyone got this working? (See update above...)
Resolver Beta: The First Wave
Today we've released the first beta version of Resolver. Resolver is a Rapid Application Development tool with a spreadsheet interface. It is written in IronPython, fully scriptable with IronPython and spreadsheets can be exported as IronPython programs.
We had a lot of people sign up for our beta, and all the support is going to be done by the developers, so we're phasing in the betas and emails have just gone out to the 'first wave'. Depending on what kind of burden this places on us for support we hope to follow this up with more soon - so if you signed up and weren't in the first wave, hang on! If you haven't signed up yet, there is still time.
If you have Resolver now, and you are wondering what next - may I suggest a visit to Resolver Hacks. This has articles and examples including the following:
A simple example spreadsheet using data, formulae and user code.
How to store data in between recalcs.
Using custom data types in Resolver, including using them in formulae.
Fetching currency exchange data from the web into a spreadsheet and then plotting a chart.
Generating HTML pages from Resolver spreadsheets.
Abusing the mechanism that Resolver has for updating a spreadsheet when a database changes to trigger a recalculation from any external data source.
An example of including the results from an external program in Resolver spreadsheets - to do advanced (3D) plotting from data.
There are also lots of other articles on Resolver Hacks (including using Resolver as an image viewer and a game of life in Resolver), so have a browse around.
All the spreadsheets are available from a Google Code SVN repository: Resolver Spreadsheets on Google Code.
Improvements we've made in Resolver (since the private beta of a few weeks ago) are:
- Undo and redo for cell edits and copy / paste operations (at last)
- Made the output pane visible by default
- Exception tracebacks are printed to the output pane
- Export to Excel with formulae
- Directory of the current spreadhseet file is added to the path for importing modules from
- External links to cells in Excel files
- Limit cell references to 3 letters plus digits (more flexibility in importing names from Excel that look like cell references)
- Colour coding of cells by type (string / number etc) and by derivation (formula / constant)
- An API tidy up
- Printing looks better
- Coloured the user code sections and the output pane in the user interface
- Sample spreadsheets included with Resolver
- Improved the look of the user documentation
Plus various bug fixes of course (particularly in the handling of non-ASCII values).
Oh, I'm pleased to report that Resolver runs fine on the Mac under Parallels.
This work is licensed under a Creative Commons Attribution-Share Alike 2.0 License.