Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > ANN: Resolver One 1.3 released

Reply
Thread Tools

ANN: Resolver One 1.3 released

 
 
Giles Thomas
Guest
Posts: n/a
 
      11-24-2008
We are proud to announce the release of Resolver One, version 1.3.
Resolver One is a spreadsheet that allows you to write Python directly
in cells, and converts the spreadsheets you create into Python
programs. It's based on IronPython, and runs on Windows.

For version 1.3, we've made two big changes:

* Our Web server, which (as you would expect) allows you to expose
your spreadsheets to other people as web applications, is now included
- it was previously a commercial-only product.
* We've added column- and row-level formulae. With these, you can
specify one formula which is then used to fill in a whole column or
row, reducing duplication and starting to bring some of the benefits
of loops to the spreadsheet world.

We've done a screencast outlining both of these: <http://
www.resolversystems.com/screencasts/release-1.3/>

Michael Foord also did a great screencast describing how you can use
Python-syntax formulae with column-level formulae to do interesting
stuff: <http://www.resolversystems.com/screencasts/column-formulae/>

Resolver One is free for non-commercial use, so if you would like to
take a look, you can download it from our website: <http://
www.resolversystems.com/download/>


Best regards,

Giles
--
Giles Thomas
MD & CTO, Resolver Systems Ltd.
(E-Mail Removed)
+44 (0) 20 7253 6372

Try out Resolver One! <http://www.resolversystems.com/get-it/>

17a Clerkenwell Road, London EC1M 5RD, UK
VAT No.: GB 893 5643 79 Registered in England and Wales as company
number 5467329.
Registered address: 843 Finchley Road, London NW11 8NA, UK
 
Reply With Quote
 
 
 
 
Jules Stevenson
Guest
Posts: n/a
 
      11-24-2008
Hi,

I have a list which contains a folder structure, for instance:

dirs=['c:\', 'temp', 'foo', 'bar']

The length of the list can vary. I'd like to be able to construct a
os.path.join on the list, but as the list can vary in length I'm unsure how
to do this neatly. I figured I could use a for loop and build the whole
statement as a string and 'eval it', but I'm aware that this is not a good
idea.

It strikes me that there probably is a very elegant way to achieve what I
want to do, any pointers much appreciated.

Cheers,

Jules

 
Reply With Quote
 
 
 
 
Tim Chase
Guest
Posts: n/a
 
      11-24-2008
> I have a list which contains a folder structure, for instance:
>
> dirs=['c:\', 'temp', 'foo', 'bar']
>
> The length of the list can vary. I'd like to be able to construct a
> os.path.join on the list, but as the list can vary in length I'm unsure how
> to do this neatly.


Sounds like you want argument unpacking:

>>> dirs=['c:\\', 'temp', 'foo', 'bar']
>>> print os.path.join(*dirs)

c:\temp\foo\bar

(side note: you can't have a single trailing backslash like your
example assignment)

The asterisk instructs python to unpack the passed list as if
each one was a positional argument. You may occasionally see
function definitions of the same form:

def foo(*args):
for arg in args:
print arg
foo('hello')
foo('hello', 'world')
lst = ['hello', 'world']
foo(*lst)

You can use "**" for dictionary/keyword arguments as well. Much
more to be read at [1].

-tkc


[1]
http://www.network-theory.co.uk/docs...Arguments.html


 
Reply With Quote
 
Jules Stevenson
Guest
Posts: n/a
 
      11-24-2008
Sorry for the noise, I found the * unpack operator. Perfect for what I need.

>
> Hi,
>
> I have a list which contains a folder structure, for instance:
>
> dirs=['c:\', 'temp', 'foo', 'bar']
>
> The length of the list can vary. I'd like to be able to construct a
> os.path.join on the list, but as the list can vary in length I'm unsure
> how
> to do this neatly. I figured I could use a for loop and build the whole
> statement as a string and 'eval it', but I'm aware that this is not a
> good
> idea.
>
> It strikes me that there probably is a very elegant way to achieve what
> I
> want to do, any pointers much appreciated.
>
> Cheers,
>
> Jules
>
> --
> http://mail.python.org/mailman/listinfo/python-list


 
Reply With Quote
 
Steve Holden
Guest
Posts: n/a
 
      11-24-2008
Jules Stevenson wrote:
> Hi,
>
> I have a list which contains a folder structure, for instance:
>
> dirs=['c:\', 'temp', 'foo', 'bar']
>

Of course this should really be

dirs=['c:\\', 'temp', 'foo', 'bar']

but we'll overlook your little syntax error

> The length of the list can vary. I'd like to be able to construct a
> os.path.join on the list, but as the list can vary in length I'm unsure how
> to do this neatly. I figured I could use a for loop and build the whole
> statement as a string and 'eval it', but I'm aware that this is not a good
> idea.
>
> It strikes me that there probably is a very elegant way to achieve what I
> want to do, any pointers much appreciated.
>

Jules:

Don't reply to someone else's post with a new question, please: many
people use "threaded" readers, and will not even see your subject line.

What you need is

os.path.join(*dirs)

which tells Python to take the list and turn it into separate arguments.
Fortunately os.path.join will take as many arguments as you care to pass it:

>>> os.path.join(*dirs)

'c:\\temp\\foo\\bar'
>>>


regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ANN: Resolver One 1.7 released Giles Thomas Python 0 10-27-2009 06:07 PM
ANN: Resolver One 1.6.5 released Giles Thomas Python 0 09-18-2009 12:11 PM
ANN: Resolver One 1.5 released Giles Thomas Python 0 06-03-2009 03:36 PM
ANN: Resolver One 1.1 released Giles Thomas Python 2 06-04-2008 06:17 PM
ANN: Resolver One 1.0 released Giles Thomas Python 0 01-17-2008 02:12 PM



Advertisments