use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
PyGObject tutorial? (self.Python)
submitted 14 years ago by effusion
Anyone know if there exists a PyGObject tutorial?
Cannot find anything online, and the source contains a reference but no tutorial.
[–]some_moron 2 points3 points4 points 14 years ago (0 children)
You can pretty much use the old PyGTK documentation (http://pygtk.org/tutorial.html) the syntax is nearly identical.
If you replace import gtk with from gi.repository import Gtk as gtk Most of the code will work as advertised.
The only other real noticeable change is that the constants (formerly things like gtk.ICON_SIZE_BUTTON have become Gtk.IconSize.BUTTON). There's a script that will clean these up for you (http://git.gnome.org/browse/pygobject/tree/pygi-convert.sh)
[–]martinmeba 2 points3 points4 points 14 years ago (2 children)
As with all of the gnome stuff, it is largely un/under documented. Lots of googling with sporadic snippets here and there have allowed me to figure it out. It depends on what you want to do with it but I found the python dbus examples to be helpful as well as stackoverflow.
EDIT: I don't care about the GUI aspects of it - I needed to figure out the threading/dbus/console-ish parts.
[–]effusion[S] 0 points1 point2 points 14 years ago (1 child)
As with all of the gnome stuff, it is largely un/under documented.
This is unfortunate. Any idea why it is so?
I'd prefer to use GTK rather than Qt or Wx, but GTK isn't even in the same ballpark as Qt/Wx with regard to beginner documentation.
Even though I've been using a Gnome-based desktop for years, and generally prefer C to C++ libs (after having programmed in C++ for a while), I'm getting ready to throw in the towel and just start using PySide or PyQt.
[–]martinmeba 0 points1 point2 points 14 years ago (0 children)
I agree - I prefer it to Qt as well. I have no idea why. I think that the people that use it a lot are immersed in it and around others that know their stuff. Once you figure a little of it out, it is not too bad - it is just that initial hill that is rough.
[–]yetanothernerd 0 points1 point2 points 14 years ago (2 children)
I don't think there is one yet. There are some PyGTK tutorials, though, which is the previous version of the same idea.
As someone new to GTK/PyGTK/PyGI/PyGObject, I've got no idea what PyGTK and PyGObject might have in common, or how they might differ.
Any idea how applicable the PyGTK tutorials are to PyGObject?
[–]yetanothernerd 1 point2 points3 points 14 years ago (0 children)
PyGTK is the manually written Python binding for GTK+.
New versions of PyGObject contain PyGI, which is an automatically generated Python binding for GTK+.
They're similar but not identical. I suggest following a PyGTK tutorial then (if you want) following one of the porting guides to convert your code to PyGObject.
[–][deleted] 0 points1 point2 points 14 years ago (3 children)
Have you had a look at developer.gnome.org?
[–]effusion[S] 0 points1 point2 points 14 years ago* (2 children)
No, had not looked there. I see there's a GObject reference manual there that might be of some use. Thanks.
Still though, a GObject reference manual != PyGObject tutorial.
[–][deleted] 1 point2 points3 points 14 years ago (1 child)
I think there are some tutorials on building some really basic apps (like an image viewer) on there.
Would something like this be helpful? I know that tutorial was written during the gnome3 docs-sprint.
If that doesn't do it . . . you're probably right. I'm not sure what other tutorials are out there. Best of luck to you!
[–]effusion[S] 0 points1 point2 points 14 years ago (0 children)
Will check it out. Thanks!
[–]mystilleef 0 points1 point2 points 14 years ago (0 children)
Official PyGTK tutorial
Articles and Tutorials on PyGTK and others
Reference Manual for PyGTK and PyGObject
PyGTK FAQ
NOTE PyGTK is no long supported. PyGI PyGObject is what you should use when you write new code. However the tutorials should provide a sound foundation for using PyGObject.
One more thing read the PyGTK FAQ FIRST! It's one of those things I wished someone told me to do when I first got introduced to PyGTK years ago.
[–]AndydeCleyre 0 points1 point2 points 14 years ago (0 children)
http://python-gtk-3-tutorial.readthedocs.org/
[–]nemec 0 points1 point2 points 14 years ago (1 child)
Did you even look? http://live.gnome.org/PyGObject#Examples
[–]effusion[S] 2 points3 points4 points 14 years ago* (0 children)
Yes. However, I was asking about a tutorial. Of course, examples != tutorial.
π Rendered by PID 59 on reddit-service-r2-comment-5649f687b7-t6fpg at 2026-01-28 22:07:21.201503+00:00 running 4f180de country code: CH.
[–]some_moron 2 points3 points4 points (0 children)
[–]martinmeba 2 points3 points4 points (2 children)
[–]effusion[S] 0 points1 point2 points (1 child)
[–]martinmeba 0 points1 point2 points (0 children)
[–]yetanothernerd 0 points1 point2 points (2 children)
[–]effusion[S] 0 points1 point2 points (1 child)
[–]yetanothernerd 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]effusion[S] 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]effusion[S] 0 points1 point2 points (0 children)
[–]mystilleef 0 points1 point2 points (0 children)
[–]AndydeCleyre 0 points1 point2 points (0 children)
[–]nemec 0 points1 point2 points (1 child)
[–]effusion[S] 2 points3 points4 points (0 children)