Python Shell

Anthony Dardis adardis at gmail.com
Tue Jan 18 17:04:01 EST 2011


I'm a little confused here. If you are writing something that lets you, the
user, type stuff in to cause the machine to tell you things about your
GnuCash data, then there's really not a question about how to program the
displaying: that's a decision to make about the thing you are writing.
Unless you are using a Python interpreter (IDLE, iPython) as your user
interface: if you are, then the question is about coding ...

If the question is, which is best for coding, that depends on how you want
to code it. If you like Python classes and object-oriented programming, then
design and write classes that have display methods, and then the instances
can display themselves. If you are less comfortable with OOP and classes, or
for some other reason the design of this project says don't use classes,
then write a function to display the object and pass the object to it.
Neither is better or more practicable than the other.

Hope that helps, Tony

On Tue, Jan 18, 2011 at 4:51 PM, Christoph Holtermann
<c.holtermann at gmx.de>wrote:

> Hello !
>
> > I thought a bit about about the displaying problem. It seems to me that
> > displaying is a task which could go into a seperate module. This
> modulecould provide a function for example "display(object)". It would also
> add a function object.display() to every object it knows. For example
> > a transaction. display(transaction) would then call
> transaction.display().
> >
> >
> Maybe i could pin down my question to : Is it more practical to have
> something that displays an object or to make
> the object display itself.
>
> bye,
>
> Christoph
>
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>


More information about the gnucash-devel mailing list