logo

 

     
 
Home
Site Map
Search
 
:: Bitwise Courses ::
 
Bitwise Dusty Archives
 
 
 

rss

 
 

ruby in steel

learn aikido in north devon

Learn Aikido in North Devon

 


Section :: software

- Format For Printing...

Resolver One: Python-programmable spreadsheet

When formulas are not enough!
Wednesday 18 August 2010.
 

Resolver One $99 / £66
http://www.resolversystems.com

Once upon a time, the dominant spreadsheet was Lotus 1-2-3. These days it’s Microsoft Excel. While Excel has added on a whole load of things that were not in 1-2-3, the essential way of working remains much the same: you enter numbers into a matrix and do calculations with formulas placed into cells.

Resolver One does things differently. It treats a spreadsheet as a fully programmable tool. You can control it using the Python language. And while it allows you to enter formulas into cells, those formulas are not just isolated commands; Resolver One translates them into Python code.

The user interface has two main sections. The spreadsheet area looks just like any standard spreadsheet with its matrix of cells. Beneath this (or, alternatively, to its right) is the coding pane. This pane contains both the code that is auto-generated from spreadsheet formulas and any code which is explicitly entered by the user. So, for example, if you want to sum a column of ten figures you might enter into cell A:10 the following formula:

=sum(A1:A9)

This formula ‘stays in the cell’ just as in any standard spreadsheet so that when you select that cell later on, you can view or change the formula in an editable field above the worksheet or by double-clicking the cell to put it into ‘edit mode’. But, behind the scenes, the formula has also generated some Python code (Resolver One uses IronPython, Microsoft’s .NET version of Python). If you look in the code window, you will see this:

workbook["Sheet1"].A10 = SUM(workbook["Sheet1"].Cells.A1.to.A9)

Code such as this, which is auto-generated from a formula, is not modifiable and it is contained in a read-only collapsible region preceded by the comment # Formula code (not editable). If you want to write your own Python code you have to do it in different regions such as #Pre-formula and # Post-formulae user code. Here you are at liberty to write ‘formulas’ entirely in Python. This type of formula can be used to calculate and display results in the spreadsheet but no corresponding spreadsheet-style formula will be embedded into a cell. For example, assuming that cells A1 to A3 contain the values, 1,2,3, the following Python code will cause the total (6) to be will displayed in cell A4:

workbook["Sheet1"].A4 = SUM(workbook["Sheet1"].Cells.A1.to.A3)

However, when you put A4 into edit mode, it will be empty. That is, it will not contain the formula (=sum(A1:A3)).

When executing code, you can also make use of the Output pane. This permits a simple kind of debugging by displaying information using the Python print statement. There is, however, no breakpoint-controlled debugger.

Resolver One can also help to generate interactive web applications which display your data with optionally editable cells. This requires an additional add-on, however, the Resolver One Web Server ($199).

So how does Resolver One compare with a more established spreadsheet such as (principally) Excel? First it has to be said that Resolver One does not have the same range of features as Excel. It doesn’t have splittable windows, for example, or pivot tables. Charting is provided by a free tool called Zed Graph: http://www.resolverhacks.net/zedgraph_basic.html but there is no graphical interface for creating charts. It’s worth pointing out that Resolver One can import and export worksheets to and from Excel. This gives you the option of using Resolver One to do programmatic analysis of Excel data if required.

For general purpose spreadsheet use - summing totals, doing calculations on columns of figures and generating charts - Resolver One doesn’t have much to commend it over Excel. On the other hand, what it does have is Python. So for a programmer who needs a modern, well-structured, dynamic object oriented language, it has undoubted attractions over Excel’s Visual Basic programmability. Unfortunately, the lack of a debugger is a significant drawback to anyone who wants to write complex programs.

AddThis Social Bookmark Button


Home