[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] Queries re. Python interface

From: Øystein O Johansen
Subject: Re: [Bug-gnubg] Queries re. Python interface
Date: Wed, 5 Jan 2005 11:56:24 +0100

> I'm starting to look at various features to add using Python rather
> than embedded C code (that's why I just added a lot of detail to the
> doc strings in gnubgmodule.c). A couple of questions:
> For testing purposes, it's handy to enter the Python interactive
> interpreter with '>>>'. But is there a way to return to gnubg and
> still have the interactive interpreter available? Typing ^D returns
> to gnubg, but now Python has stdin marked as EOF, so you can't use it
> again.

Adding features in Python should be much simpler. As it works now there
is lots of limitations and a lot tricks to know just to make really
simple things. I believe it right to reveal the python interface to the
users. I'm thinking of ways to do this and I'm looking at other
applications that has an interface to Python.

First I'm looking at Blender. In Blender it's possible to open a text
editor window (in the application gui) type your code right in, and then
save/load/run menu options are available as menu options.

The Gimp also has an interface against Python. This is more a way to
write plug-ins in the Gimp, and I believe it's used by a lot of people.

What about GNU Backgammon? Can we integrate a simple editor window in
the user interface like it's done in Blender?

> Another query - has anyone tried using Python/tkinter from a script
> invoked by gnubg? Are there potential or known problems with creating
> tkinter windows from gnubg in GUI mode? I know you won't get window
> updates, but perhaps we could provide an interface function to do
> this - without it, moving a tkinter window leaves a hole in the gnubg
> board.

Yes... quite annoying...

> I'm thinking that creating configuration windows is tedious and
> error-prone in C, whereas it's very easy from Python, so if we wanted
> to make better use of the database, it would be nice not to have to
> do things in C.

Development is much faster in Python than in C. If the Python
interfacing was more flexible I would have loved doing things in Python
instead of C.

(Just a trick from my sleeve: When I make windows layout and dialog
boxes in GTK, I usually use Glade. Then I just click and place the
different widgets. I let Glade generate the C code, though I must say
I'm doing some modifications to the code Glade generates.)

[snip feature suggestion]

Sounds like a great feature to me. How do you want the user interface to
look like? I could make it in glade and send you the c code. ?


The information contained in this message may be CONFIDENTIAL and is
intended for the addressee only. Any unauthorised use, dissemination of the
information or copying of this message is prohibited. If you are not the
addressee, please notify the sender immediately by return e-mail and delete
this message.
Thank you.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]