Python + PyGTK + WebKit in 20 minutes
Posted at 5:45pm on Tuesday May 11th 2010
In season 2 episode 7 of our podcast we laid down the simple challenge for each of the four podcasters - Andrew, Graham, Paul and Mike - to produce something original for the website. Paul - eager to show the world how much he, er, loves Python - has now finished his entry, and you'll find it below: a video talking you through how to get started with Python, PyGTK and WebKit. It's easier than you think!
You should follow us on Identi.ca or Twitter


Copyright 2010 Future Publishing Limited (company
registered number 2008885), a company registered
in England and Wales whose registered office is at
Beauford Court, 30 Monmouth Street, Bath, BA1 2BW, UK
Your comments
So Simple
Will Warren (not verified) - May 11, 2010 @ 6:50pm
This video was really good, I've used pyGTK before but never the webkit module. It looks very versatile and easy to work with!
Great video and really well explained. If i could rate this video it would be 5 stars! :D
Thanks
Anonymous Penguin (not verified) - May 11, 2010 @ 8:05pm
Really enjoyed your video, it wakes my programming apetite
Thanks
Excellent!
Jean Christophe André (not verified) - May 11, 2010 @ 9:09pm
Really an excellent presentation!
I can only recommend it!
wonderfull
ThorstenS (not verified) - May 11, 2010 @ 10:11pm
wow, this screencast is really wonderfull.
I have never seen such an easy introduction into python+gtk.
keep on!
/thorsten
Brilliant!
Ray Woods (not verified) - May 11, 2010 @ 10:24pm
In my few years using Linux I've heard of these technologies but without understanding what they actually do. Although running at a frantic pace, Paul's introduction clearly shows just some of the possibilities open to us.
Once I've gone through my C coding books I at least now have an idea where to go for the next step.
Thanks Paul.
Re: frantic pace
Hudzilla - May 11, 2010 @ 10:38pm
Yes, it was recorded in a single take and in a great rush because I've spent most of today sending the latest issue of LXF off to the printers and still had a few more to go when I was recording this. 20 minutes is quite a short amount of time to cover all the things you do in the video, and in a way the pace of the recording reflects the speed of production with PyGTK - you can get so much done with so little code that my fingers naturally move faster than even I can speak ;)
Awesome!
Neil Munro (not verified) - May 12, 2010 @ 12:00am
I actually found I could keep up with this tutorial it was amazing to have a quick introduction to how to work with webkit from within python and GTK.
If this video had been available 18 months ago, my final year uni project would have been so much better :P
really good stuff
marines (not verified) - May 12, 2010 @ 2:00am
thanks for that :)
A good start
Jeenu (not verified) - May 12, 2010 @ 6:11am
Thanks for taking time to put up such a nice tutorial. It sure is a good starting point for anyone to learn PyGtk! And excellent presentation too.
What did you use to create the screencast?
Crispibits - May 12, 2010 @ 11:35am
Haven't had a chance to watch the whole thing (pesky work keeps getting in the way), but looks good so far. What program did you use to actually record the screencast?
Love, Light and Peace, Crispibits
Repeat that same "You dare us" challenge
kltrg (not verified) - May 12, 2010 @ 11:41am
I wish you would repeat that same "You dare us" challenge in every episode and you, Paul, would produce such a video tutorial every two weeks.
I started learning Phyton a while ago but I never really managed to create a real app because I just could not read all those written tutorials. What I would need is probably a mentor I can ask every question I want. Such video tutorials are halfway between reading a tutorial and talking to a person so I'd like to see more (or get you, Paul, to answer all my questions :D )
Great
Cormac (not verified) - May 12, 2010 @ 1:55pm
Great video Paul. I think you should do more of these. Much easier to follow than an article.
Brilliant!
Tobi - May 12, 2010 @ 4:18pm
Loved it! Have been playing with Python for a while and would have really loved to start with a tutorial like this! A great amount of information ery well explained - others let you read for 3 hours to get the same stuff.
Well Done!
dar (not verified) - May 12, 2010 @ 6:26pm
I'm very impressed with this tutorial. It has a good conceptual flow and good productions qualities such as code that is readable and a voice is understandable. It is also my first introduction to a TuxRadar code tutorial.
btw: love the magazine.
Excellent video
Blarney (not verified) - May 13, 2010 @ 11:07am
Well done. Exactly what I wanted.
Cool!
Stephen Ward (not verified) - May 13, 2010 @ 1:24pm
Very inspiring! I agree that this is a much easier to follow than a dry article which always looks a bit daunting. This way, especially with python's command interpretor, you can see what's supposed to happen at each step.
Great video, I haven't
Jon Pritchard (not verified) - May 13, 2010 @ 5:40pm
Great video, I haven't watched it all yet but I love how you've used the interpreter, really shows off the power of the tools
In my entire Computing A-Level I didn't see as impressive an example as that.
Brilliant!
Cage - May 14, 2010 @ 8:39am
More of these please!
i vote for this one!
uomosenzanome - May 14, 2010 @ 7:20pm
Although I haven't seen the video yet, this couldn't possibly be as bad as the other submissions, so I vote for it!
I don't even program and I
Anonymous Penguin (not verified) - May 14, 2010 @ 10:03pm
I don't even program and I found this video entertaining.
I love it!
Anonymous Penguin (not verified) - May 18, 2010 @ 11:07am
I love this and would really like to see more screencasts like this! Great content, great format.
awesome
ssword (not verified) - May 20, 2010 @ 3:44pm
Your video is awesome, I love it. You made python really simple.
liked it but foggy...
Anonymous Penguin (not verified) - May 20, 2010 @ 10:22pm
great video.. why don't you put the super high res too?
kind of foggy when I played it full screen...
[by the way I tried both mov and ogv]
+1
Evan (not verified) - May 22, 2010 @ 1:40am
Too good Paul. Adding my thanks. Consider doing a series. You'll be famous/er.
Crashing on Ubuntu 9.10 and 10.04
Sad Penguin (not verified) - May 22, 2010 @ 10:24pm
Python 2.6.4 on Ubuntu 9.10 32-bit crashes on the "browser = webkit.WebView()" line with error:
GLib-ERROR **: The thread system is not yet initialized.
aborting...
Aborted
:(
Python 2.6.5 on Ubuntu 10.04 32-bit crashes on the same line with endless output saying "error: line XXX: bad flag vector alias" and "bad flag alias index: 0"
:(
Crashing Solved
No Longer Sad Penguin (not verified) - May 23, 2010 @ 9:20am
https://bugs.launchpad.net/ubuntu/+source/pywebkitgtk/+bug/480398
After importing webkits on Ubuntu 9.10, the following is required:
gtk.gdk.threads_init()
It gives an error about multiple table definitions (?) and failure loading some AFF file, but the browser works.
Haven't tested on Ubuntu 10.04.
Progress Bar in Ubuntu 9.10
No Longer Sad Penguin (not verified) - May 23, 2010 @ 10:19am
The method name for showing and hiding the progress bar in Ubuntu 9.10 (with whichever version of webkit it has) is:
progress.set_child_visible
and not
progress.set_visible
(I've not used GTK/webkit until viewing this video, so I'm not an expert. The "child_visible" method worked, so I'm presuming that's what should be used. However, the space occupied by the progress bar remains at the bottom of the window. In the video, when the progress bar is removed, the browser space increases; on mine, the space for the bar is always allocated below the scrollbar.)
Is the code used there published anywhere
Anonymous Penguin (not verified) - May 23, 2010 @ 10:22am
Awesome video tutorial at a breakneck pace, as many have already said. Full points from me !
How about making the code used in the tutorial available for download?
Really enjoyed the video!
Anonymous Penguin (not verified) - May 27, 2010 @ 10:49am
Really enjoyed the video! Great stuff, have always wanted to get back into programming, and it's great to see it actually occuring in action. Can we have some more please? And would this also work on my N900 running maemo 5?
Thanks,
Dunc
Oh, very nice!
Dan Dart (not verified) - June 3, 2010 @ 6:44pm
Terrifically exciting! Just the sort of thing I needed, really. If only I didn't need so many dependencies!
Really wonderful! I like how
Moritz (not verified) - June 20, 2010 @ 10:56pm
Really wonderful!
I like how quick you talk and show how it works!
I don't want to wait longer ;)
how can i keep it?????
juanska (not verified) - July 3, 2010 @ 2:11am
how can I keep the browser or use it???? there's any way to save it? when I exit from Python I have to restart everything or there is a way to open it???
Thank for the tutorial
Post new comment