ANN: Resolver One 1.3 released

Discussion in 'Python' started by Giles Thomas, Nov 24, 2008.

  1. Giles Thomas

    Giles Thomas Guest

    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.

    +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
    Giles Thomas, Nov 24, 2008
    #1
    1. Advertising

  2. for loop specifying the amount of vars

    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
    Jules Stevenson, Nov 24, 2008
    #2
    1. Advertising

  3. Giles Thomas

    Tim Chase Guest

    Re: for loop specifying the amount of vars

    > 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/pytut/KeywordArguments.html
    Tim Chase, Nov 24, 2008
    #3
  4. RE: for loop specifying the amount of vars

    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
    Jules Stevenson, Nov 24, 2008
    #4
  5. Giles Thomas

    Steve Holden Guest

    Re: for loop specifying the amount of vars

    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/
    Steve Holden, Nov 24, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Giles Thomas

    ANN: Resolver One 1.0 released

    Giles Thomas, Jan 17, 2008, in forum: Python
    Replies:
    0
    Views:
    286
    Giles Thomas
    Jan 17, 2008
  2. Giles Thomas

    ANN: Resolver One 1.1 released

    Giles Thomas, Jun 4, 2008, in forum: Python
    Replies:
    2
    Views:
    287
    Giles Thomas
    Jun 4, 2008
  3. Giles Thomas

    ANN: Resolver One 1.5 released

    Giles Thomas, Jun 3, 2009, in forum: Python
    Replies:
    0
    Views:
    316
    Giles Thomas
    Jun 3, 2009
  4. Giles Thomas

    ANN: Resolver One 1.6.5 released

    Giles Thomas, Sep 18, 2009, in forum: Python
    Replies:
    0
    Views:
    228
    Giles Thomas
    Sep 18, 2009
  5. Giles Thomas

    ANN: Resolver One 1.7 released

    Giles Thomas, Oct 27, 2009, in forum: Python
    Replies:
    0
    Views:
    314
    Giles Thomas
    Oct 27, 2009
Loading...

Share This Page