From: Tracubik on
Hi all!
i'm giving away to a friend of mine that have a garage (he repair car) my
old computer. He will use it essentialy to create estimates of the work
via an ods file (i've made a simple ods file to be filled with the cost of
materials and a description of the work).
He's totally new with computer and have difficult to fill the ods file, so
i'ld like to create a simple python program that help him to introduce the
data in to the ods file via a simple gui.
So what i'm looking for is a way in python to insert data in a particular
cell of the ods file and possibly to save it and print it when it's full
filled with data.

the guy is similar to this:

3 fields: quantity - description of the piece bought - price

a way to add a new "line" if needed (for a new piece entry) similar to the
"add rule" in evolution

1 text field for the description of the work + 1 field for the price of
the work

and off course a way to insert this data in to the ods file via python

Any hints/tutorial/info?

thanks
Nico
From: Chris Rebert on
On Wed, Mar 31, 2010 at 12:47 AM, Tracubik <affdfsdfdsfsd(a)b.com> wrote:
> Hi all!
> i'm giving away to a friend of mine that have a garage (he repair car) my
> old computer. He will use it essentialy to create estimates of the work
> via an ods file (i've made a simple ods file to be filled with the cost of
> materials and a description of the work).
> He's totally new with computer and have difficult to fill the ods file, so
> i'ld like to create a simple python program that help him to introduce the
> data in to the ods file via a simple gui.
> So what i'm looking for is a way in python to insert data in a particular
> cell of the ods file and possibly to save it and print it when it's full
> filled with data.
>
> the guy is similar to this:
>
> 3 fields: quantity - description of the piece bought - price
>
> a way to add a new "line" if needed (for a new piece entry) similar to the
> "add rule" in evolution
>
> 1 text field for the description of the work + 1 field for the price of
> the work
>
> and off course a way to insert this data in to the ods file via python
>
> Any hints/tutorial/info?

PyUNO: http://wiki.services.openoffice.org/wiki/PyUNO_bridge

Cheers,
Chris
--
http://blog.rebertia.com
From: bobicanprogram on
On Mar 31, 2:47 am, Tracubik <affdfsdfds...(a)b.com> wrote:
> Hi all!
> i'm giving away to a friend of mine that have a garage (he repair car) my
> old computer. He will use it essentialy to create estimates of the work
> via an ods file (i've made a simple ods file to be filled with the cost of
> materials and a description of the work).
> He's totally new with computer and have difficult to fill the ods file, so
> i'ld like to create a simple python program that help him to introduce the
> data in to the ods file via a simple gui.
> So what i'm looking for is a way in python to insert data in a particular
> cell of the ods file and possibly to save it and print it when it's full
> filled with data.
>
> the guy is similar to this:
>
> 3 fields: quantity - description of the piece bought - price
>
> a way to add a new "line" if needed (for a new piece entry) similar to the
> "add rule" in evolution
>
> 1 text field for the description of the work + 1 field for the price of
> the work
>
> and off course a way to insert this data in to the ods file via python
>
> Any hints/tutorial/info?
>
> thanks
> Nico


OOcalc supports a little known feature whereby data can be
automatically sync'd between the spreadsheet and an HTML table. A
few years ago I did up a demo of this in action using Tcl/Tk (http://
www.icanprogram.com/hosug). It should not be too hard to port this
idea to Python.

bob
From: rantingrick on
On Mar 31, 2:47 am, Tracubik <affdfsdfds...(a)b.com> wrote:
> Hi all!
> i'm giving away to a friend of mine that have a garage (he repair car) my
> old computer. He will use it essentialy to create estimates of the work
> via an ods file (i've made a simple ods file to be filled with the cost of
> materials and a description of the work).
> He's totally new with computer and have difficult to fill the ods file, so
> i'ld like to create a simple python program that help him to introduce the
> data in to the ods file via a simple gui.
> So what i'm looking for is a way in python to insert data in a particular
> cell of the ods file and possibly to save it and print it when it's full
> filled with data.
>
> the guy is similar to this:
>
> 3 fields: quantity - description of the piece bought - price


So what is your plan...?
* Pop up a dialog with three entrys,
* have him fill out the three entrys,
* then have python insert the data into the spreadsheet?
....Why bother messing with OO, too much trouble for me?

If the guy is that scared of spreadsheets I would skip the spreadsheet
all together and just use a Tk.Listbox to display the data. Create a
big button at the bottom (preferably in Times 20 red font) that says
"NEW INPUT" and let him edit lines by double clicking on them. You
need a good Scrolled Listbox with a nice interface, an entry dialog,
and some file IO with backup protection. Thats about it.

I would probably create a new file every day, week, or month depending
on the amount of data he enters daily, you don't want to load enormous
files into a Tk.Listbox. Then just save all the data as csv and you
can always load it into a spreadsheet later if the IRS comes knocking,
or you need to print a professional looking spreadsheet ;-). Simple,
100% python solution!

If you want to do this and need help i would be happy to offer my
assistance. This would be a "fairly" simple script and great learning
experience for you.
From: eglyph on
On Apr 1, 6:53 am, rantingrick <rantingr...(a)gmail.com> wrote:

> > 3 fields: quantity - description of the piece bought - price
>
> So what is your plan...?
>   * Pop up a dialog with three entrys,
>   * have him fill out the three entrys,
>   * then have python insert the data into the spreadsheet?
> ...Why bother messing with OO, too much trouble for me?

Totally agree with you. No need for a heavy machinery in this case.

> Then just save all the data as csv and you
> can always load it into a spreadsheet later if the IRS comes knocking,
> or you need to print a professional looking spreadsheet ;-).  Simple,
> 100% python solution!

Actually, a spreadsheet based solution isn't best fit for such a task.
I'd recommend to store the data in sqlite3 (also 100% pure python as
the module is in the stdlib). CSV is good for making invoices or
something like that.