/home/nand

Entries Comments


Date: April 4th, 2008

Python power

4 April, 2008 (13:13) | Linux | 4 comments

Since I started hacking with python a few months ago, I never stopped being amazed by its power.
Wanna display you webcam video on a very simple GTK+ app? Less than one hundred lines, thanks to pygst (gstreamer) and pygtk!
#!/usr/bin/env python

import sys, os
import pygtk, gtk, gobject
import pygst
pygst.require(”0.10″)
import gst

class GTK_Main:

def __init__(self):
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.set_title(”Webcam-Viewer”)
window.set_default_size(500, 400)
window.connect(”destroy”, gtk.main_quit, “WM […]