Re: How to decide (and know) which Python GTK version to use?

2018-07-31 Thread Chris Green
Michael Torrie  wrote:
> On 07/30/2018 11:04 AM, Akkana Peck wrote:
> > Yes, this is the future, since it lets you use both GTK3 and Python3.
> 
> Unfortunately the automatically-generated bindings, while fast and
> complete, are not quite as pythonic as the old PyGTK bindings were.  The
> abstraction layer pygobject provides leaks some of the underlying C-isms
> through.  I can't remember exactly which bits feel the most foreign as
> it's been a while since I used it.  But who am I kidding?  PyQt (my
> preferred toolkit) or PySide aren't terribly Pythonic either; lots of
> C++ and Qt abstractions leaking through various Qt types when native
> Python types would be preferable (like lists and dictionaries).

Yes, this has been some of my problem when starting to use these
packages.  I'm a retired Software Engineer and I spent much of my
career (like the last 40 years or more) writing C/C++, so seeing C-like
code isn't 'difficult', but it can be confusing.  Some of the bits of
'example' code are actually C/C++ rather than Python which had me very
confused for a while!

Also there's the oddity of Gtk.Window and Gtk.Window.new (also due to
the C/C++ ancestry?).

-- 
Chris Green
·
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to decide (and know) which Python GTK version to use?

2018-07-31 Thread Chris Green
Liste guru  wrote:
> Il 30/07/2018 19:31, Chris Green ha scritto:
> 
> > OK, thanks, where is its home and full API documentation etc.?
> > -- Chris Green·-- https://mail.python.org/mailman/listinfo/python-list
> 
> On the first page of the official docs, 
> http://pygobject.readthedocs.io/en/latest/, there are the links to the 
> Python Gtk3 Tutorial, to the Python GI API Reference and all you need to 
> start to work with Pygobject and Gtk3.
> 
Excellent, thank you, it did take me a few seconds to find the links
but they are there!  It would have been more obvious if they had been
repeated in the side bar (but maybe I'm just being obtuse!).

> Just a side note: Gtk3 uses the gobject-introspection (and, for Python, 
> PyGobect) to 'connect' the library to Python (or with Lua or Vala) but 
> the same introspection system is used also for different library, 
> graphical (GStreamer or Goocanvas) or not (Gio).
> 
Ah, that's why it's "import gi", thank you some more.  :-)

-- 
Chris Green
·
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to decide (and know) which Python GTK version to use?

2018-07-30 Thread Michael Torrie
On 07/30/2018 11:04 AM, Akkana Peck wrote:
> Yes, this is the future, since it lets you use both GTK3 and Python3.

Unfortunately the automatically-generated bindings, while fast and
complete, are not quite as pythonic as the old PyGTK bindings were.  The
abstraction layer pygobject provides leaks some of the underlying C-isms
through.  I can't remember exactly which bits feel the most foreign as
it's been a while since I used it.  But who am I kidding?  PyQt (my
preferred toolkit) or PySide aren't terribly Pythonic either; lots of
C++ and Qt abstractions leaking through various Qt types when native
Python types would be preferable (like lists and dictionaries).
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to decide (and know) which Python GTK version to use?

2018-07-30 Thread Liste guru

Il 30/07/2018 19:31, Chris Green ha scritto:


OK, thanks, where is its home and full API documentation etc.?
-- Chris Green·-- https://mail.python.org/mailman/listinfo/python-list


On the first page of the official docs, 
http://pygobject.readthedocs.io/en/latest/, there are the links to the 
Python Gtk3 Tutorial, to the Python GI API Reference and all you need to 
start to work with Pygobject and Gtk3.


Just a side note: Gtk3 uses the gobject-introspection (and, for Python, 
PyGobect) to 'connect' the library to Python (or with Lua or Vala) but 
the same introspection system is used also for different library, 
graphical (GStreamer or Goocanvas) or not (Gio).


    Daniele Forghieri

--
https://mail.python.org/mailman/listinfo/python-list


Re: How to decide (and know) which Python GTK version to use?

2018-07-30 Thread Chris Green
Akkana Peck  wrote:
> Chris Green writes:
> > I wrote a Python GUI program a little while ago that uses Python GTK
> > with:-
> > 
> > import gtk
> > 
> > I *think* this is probably GTK 2, or something.  I can't find the
> > proper documentation for this.  Is it old/obsolescent?
> 
> Yes, it's obsolete, and AFAIK it only works with Python 2, making
> it even more obsolete; but the documentation is at
> https://developer.gnome.org/pygtk/stable/
> 
> > I'm just starting to write another program now and I seem to be using
> > GTK 3 (maybe!) by doing:-
> > 
> > import gi
> > gi.require_version('Gtk', '3.0')
> > from gi.repository import Gtk
> > 
> > Is this the right/best place to be?
> 
> Yes, this is the future, since it lets you use both GTK3 and Python3.
> 
OK, thanks, where is its home and full API documentation etc.?

-- 
Chris Green
·
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to decide (and know) which Python GTK version to use?

2018-07-30 Thread Akkana Peck
Chris Green writes:
> I wrote a Python GUI program a little while ago that uses Python GTK
> with:-
> 
> import gtk
> 
> I *think* this is probably GTK 2, or something.  I can't find the
> proper documentation for this.  Is it old/obsolescent?

Yes, it's obsolete, and AFAIK it only works with Python 2, making
it even more obsolete; but the documentation is at
https://developer.gnome.org/pygtk/stable/

> I'm just starting to write another program now and I seem to be using
> GTK 3 (maybe!) by doing:-
> 
> import gi
> gi.require_version('Gtk', '3.0')
> from gi.repository import Gtk
> 
> Is this the right/best place to be?

Yes, this is the future, since it lets you use both GTK3 and Python3.

...Akkana
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to decide (and know) which Python GTK version to use?

2018-07-30 Thread Chris Green
Chris Green  wrote:
> I want to decide which is the 'best' Python GTK to use on my Linux
> (xubuntu) systems.  There seem to be quite a few versions of Python
> GTK bindings out there and I'm confused!  
> 
> I wrote a Python GUI program a little while ago that uses Python GTK
> with:-
> 
> import gtk
> 
> I *think* this is probably GTK 2, or something.  I can't find the
> proper documentation for this.  Is it old/obsolescent?
> 
> 
> I'm just starting to write another program now and I seem to be using
> GTK 3 (maybe!) by doing:-
> 
> import gi
> gi.require_version('Gtk', '3.0')
> from gi.repository import Gtk
> 
> Is this the right/best place to be?
> 
> 
> I know this is a bit of a "how long is a piece of string" question but
> some guidance would be very welcome.  The stuff I write is purely for
> my own use and will only ever run on Linux (mostly xubuntu but also
> some other Debian derived systems such as Rasbian and Debian on
> Beaglebone).
> 
Further to the above the following page:-

https://docs.python.org/3/library/othergui.html

Seems to muddy the water even further as the links don't *seem* to
take one to the places one would expect them to go to.  The PyGObject
link goes to https://wiki.gnome.org/Projects/PyGObject and the PyGtk
link goes to https://pygobject.readthedocs.io/en/latest/ which would
also appear to be pygobject.

-- 
Chris Green
·
-- 
https://mail.python.org/mailman/listinfo/python-list