analitics

Pages

Tuesday, December 29, 2009

New book for kids with Python 3

Few days ago i found a new site about python .
I saw on this site the a new book about python for kids .
This is the link "Snake Wrangling for Kids".
The author says:
  • Snake Wrangling for Kids” is a printable electronic book, for children 8 years and older, who would like to learn computer programming. It covers the very basics of programming, and uses the Python 3

Friday, November 13, 2009

GTK - get display resolution

Sometime is need to get the display resolution.
This python code show how to do it:
>>> import gtk
>>> dgd=gtk.gdk.display_get_default()
>>> gsd=dgd.get_default_screen()
>>> height=gsd.get_height()
>>> width=gsd.get_width()
>>> print "height=",height,"width=",width
height= 1024 width= 1280

Quite simply ...