<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;D0QMSH87cSp7ImA9WhRUEk8.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929</id><updated>2012-01-22T01:43:09.109-08:00</updated><category term="resize" /><category term="matplotlib" /><category term="Numeric" /><category term="PyGUI" /><category term="logging" /><category term="PIL" /><category term="calendar" /><category term="PyCon 2011" /><category term="yield" /><category term="Visual Studio" /><category term="conky" /><category term=".strip()" /><category term="client" /><category term="3d" /><category term="GLUT" /><category term="free" /><category term="pygtk" /><category term="penguin" /><category term="subprocess" /><category term="HTMLParser" /><category term="thumbnails" /><category term="fedora" /><category term="functions" /><category term="fullscreen" /><category term="%" /><category term="random string" /><category term="GUI" /><category term="picasa" /><category term="module" /><category term="windows xp" /><category term="opengl" /><category term="merlin" /><category term="python" /><category term="gdata" /><category term="debian" /><category term="windows" /><category term="urllib" /><category term="random list" /><category term="MD5" /><category term="xp" /><category term="StandardError" /><category term="kids" /><category term="linux" /><category term="weather" /><category term="xml" /><category term="feed" /><category term="os" /><category term="sys" /><category term="sqlite" /><category term="pyparsing" /><category term="tutorial" /><category term="random" /><category term="gdkpixbuff" /><category term="gtk" /><category term="modules" /><category term="format" /><category term="2.7" /><category term="django" /><category term="book" /><category term="thumbnail" /><category term="minidom" /><category term="socket" /><category term="numpy" /><category term="glade" /><category term="pyopengl" /><category term="except" /><category term="teapot" /><category term="tutorials" /><category term="try" /><category term="&quot;tips and tricks&quot;" /><category term="plotting" /><category term="pygame" /><category term="bnr" /><category term="random passwords" /><category term="maps" /><category term="spynner" /><category term="pyglet" /><category term="error" /><category term="password" /><category term="google" /><category term="win32com" /><title>python-catalin</title><subtitle type="html">Programming in python</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://python-catalin.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>55</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Python-catalin" /><feedburner:info uri="python-catalin" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;AkEMSHoyeSp7ImA9WhRRE00.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-708922063895679977</id><published>2011-11-26T03:57:00.000-08:00</published><updated>2011-11-26T03:58:09.491-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-26T03:58:09.491-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="socket" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="client" /><title>Simple socket client with python</title><content type="html">I made version of client server socket program.&lt;br /&gt;
This example was presented in a previous post named  &lt;a href="http://python-catalin.blogspot.com/2011/11/simple-socket-server-with-python.html"&gt;Simple socket server with python&lt;/a&gt;.&lt;br /&gt;
The program is simple, the algorithm uses connection and some data processing input from the console.&lt;br /&gt;
I used the same test method as for the program created in C + +.&lt;br /&gt;
The program breaks the connection when the client enter: &lt;b&gt;end connection&lt;/b&gt;&lt;br /&gt;
Here's the source code:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;import socket
import sys

HOST = 'your-IP'
PORT = 5001             
s = None
for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM):
    af, socktype, proto, canonname, sa = res
    try:
 s = socket.socket(af, socktype, proto)
    except socket.error, msg:
 s = None
 continue
    try:
 s.connect(sa)
    except socket.error, msg:
 s.close()
 s = None
 continue
    break
if s is None:
    print 'could not open socket'
    sys.exit(1)
data=''
while data&lt;&gt;'end connection':
 data=raw_input()
 s.send(data)
 data = s.recv(1024)

s.close()
print 'Received', repr(data)&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-708922063895679977?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/usHJ-7zDKfYeQNIeUrljdP91KQU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/usHJ-7zDKfYeQNIeUrljdP91KQU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/usHJ-7zDKfYeQNIeUrljdP91KQU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/usHJ-7zDKfYeQNIeUrljdP91KQU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/5F5jLlJu0EQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/708922063895679977/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/11/simple-socket-client-with-python.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/708922063895679977?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/708922063895679977?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/5F5jLlJu0EQ/simple-socket-client-with-python.html" title="Simple socket client with python" /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><thr:total>0</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/11/simple-socket-client-with-python.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUADSX88fSp7ImA9WhRSF0Q.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-8122272028831173295</id><published>2011-11-20T04:55:00.000-08:00</published><updated>2011-11-20T04:56:18.175-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-20T04:56:18.175-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="socket" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><title>Simple socket server with python</title><content type="html">It is a small example I created a server to see how it works with a client program made ​​in C + +.&lt;br /&gt;
I can not say that it really is a server that does not accept multiple connections.&lt;br /&gt;
The script worked stable sending manually entered text.&lt;br /&gt;
I not checked the stability for the large data streams.&lt;br /&gt;
It is also normal because as you see below is just one example.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
import socket 
HOST = 'your-IP'
PORT = 5001
s= socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST,PORT))
s.listen(1)
conn,addr=s.accept()
print 'Conectat la =',addr
while 1:
 data = conn.recv(1024)
 if not data : 
  break
 conn.send(data)
 print data
conn.close()
&lt;/code&gt;&lt;/pre&gt;The distance between me and the server was considerable.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-8122272028831173295?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/6gj-8z4gDY31cqyO_Woclo_jcbc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6gj-8z4gDY31cqyO_Woclo_jcbc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/6gj-8z4gDY31cqyO_Woclo_jcbc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6gj-8z4gDY31cqyO_Woclo_jcbc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/W3TJix9IwmQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/8122272028831173295/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/11/simple-socket-server-with-python.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/8122272028831173295?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/8122272028831173295?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/W3TJix9IwmQ/simple-socket-server-with-python.html" title="Simple socket server with python" /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><thr:total>0</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/11/simple-socket-server-with-python.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkUMQX89cCp7ImA9WhdaFUk.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-5257526408419487814</id><published>2011-10-25T03:56:00.000-07:00</published><updated>2011-10-25T03:58:00.168-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-25T03:58:00.168-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="spynner" /><category scheme="http://www.blogger.com/atom/ns#" term="module" /><title>The python module : spynner</title><content type="html">On &lt;a href="http://code.google.com/p/spynner/"&gt;official site&lt;/a&gt; we see the description of the spynner module :&lt;br /&gt;
&lt;blockquote&gt;Spynner is a stateful programmatic web browser module for Python with Javascript/AJAX support based upon the QtWebKit framework.&lt;/blockquote&gt;The module is esay to use. With few lines of codes you can use this module to parse ,view and use web pages.&lt;br /&gt;
&lt;code&gt;&lt;pre&gt;from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
import re
import spynner
from BeautifulSoup import BeautifulSoup
import time
br = spynner.Browser()
br.create_webview()
br.show()
br.set_html_parser(BeautifulSoup)
br.load("http://www.linuxtoday.com/")
br.fill("input[name=username]", "name")
br.fill("input[name=passwd]", "pass")
#br.simulate_click("input[name=submit]",True)
#br.select("IBESNA~US")
#br.select('option[value="IBESNA~US"]')
#br.wait_page_load()
br.browse()
&lt;/pre&gt;&lt;/code&gt;&lt;br /&gt;
The result is show in the image bellow:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-iVgDO711dQg/TqaU2Yw1JzI/AAAAAAAAKVM/14Ly57tDsys/s1600/spynner.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="176" width="320" src="http://3.bp.blogspot.com/-iVgDO711dQg/TqaU2Yw1JzI/AAAAAAAAKVM/14Ly57tDsys/s320/spynner.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;The source code is not complete. I make this simple example just to show us how to fill some editbox.&lt;br /&gt;
If you wantthen you can develop this script and make more useful.&lt;br /&gt;
I wait your answers with source code additions and new ways of using this python module.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-5257526408419487814?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XcBzJTnDLGMzcvDk0JiGIYQuUKw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XcBzJTnDLGMzcvDk0JiGIYQuUKw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XcBzJTnDLGMzcvDk0JiGIYQuUKw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XcBzJTnDLGMzcvDk0JiGIYQuUKw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/rrRi_kSzDJM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/5257526408419487814/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/10/python-module-spynner.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/5257526408419487814?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/5257526408419487814?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/rrRi_kSzDJM/python-module-spynner.html" title="The python module : spynner" /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-iVgDO711dQg/TqaU2Yw1JzI/AAAAAAAAKVM/14Ly57tDsys/s72-c/spynner.jpg" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/10/python-module-spynner.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQFQHozcSp7ImA9WhdUFEo.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-207900639140522449</id><published>2011-10-01T05:31:00.000-07:00</published><updated>2011-10-01T05:31:51.489-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-01T05:31:51.489-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="picasa" /><category scheme="http://www.blogger.com/atom/ns#" term="gdata" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><title>Show photo albums and storage with python and gdata module</title><content type="html">The example i show today has tow parts.&lt;br /&gt;
First I use module getpass and i connect to google user account.&lt;br /&gt;
Next I use gdata functions to print user albums and spending storage.&lt;br /&gt;
You can also use the gdata module to add comments, rotate photos, add photos ...&lt;br /&gt;
The code source is show bellow:&lt;br /&gt;
&lt;code&gt;import getpass&lt;br /&gt;
import gdata.photos, gdata.photos.service&lt;br /&gt;
pws = gdata.photos.service.PhotosService()&lt;br /&gt;
username=raw_input("username - ")&lt;br /&gt;
password= getpass.getpass("password - ")&lt;br /&gt;
&lt;br /&gt;
pws.ClientLogin(username, password)&lt;br /&gt;
&lt;br /&gt;
#get all albums from account&lt;br /&gt;
userfeed_albums = pws.GetUserFeed(kind='album')&lt;br /&gt;
&lt;br /&gt;
#print albums&lt;br /&gt;
print "User %s has these albums: %s" % (userfeed_albums.user.text,&lt;br /&gt;
  [a.title.text for a in userfeed_albums.entry])&lt;br /&gt;
&lt;br /&gt;
#print storage&lt;br /&gt;
print "%s is spending %s-Mb on storage" % \&lt;br /&gt;
 (userfeed_albums.nickname.text, int(userfeed_albums.quotacurrent.text)/1024/1024)&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-207900639140522449?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vfwh6QGdyuKXyIHz8k77K6325OU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vfwh6QGdyuKXyIHz8k77K6325OU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/vfwh6QGdyuKXyIHz8k77K6325OU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vfwh6QGdyuKXyIHz8k77K6325OU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/qpZsgnho9hk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/207900639140522449/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/10/show-photo-albums-and-storage-with.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/207900639140522449?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/207900639140522449?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/qpZsgnho9hk/show-photo-albums-and-storage-with.html" title="Show photo albums and storage with python and gdata module" /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><thr:total>0</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/10/show-photo-albums-and-storage-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A08MR3k8eCp7ImA9WhdVGU4.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-8003265472275645891</id><published>2011-09-25T01:38:00.000-07:00</published><updated>2011-09-25T01:38:06.770-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-25T01:38:06.770-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="module" /><category scheme="http://www.blogger.com/atom/ns#" term="functions" /><title>Tips and tricks with Python ...</title><content type="html">Sometimes when using new modules, we are confronted with the following problem.&lt;br /&gt;
The modules come with many features that are not fully documented.&lt;br /&gt;
Some of them we do not know.&lt;br /&gt;
We can use the &lt;b&gt;dir&lt;/b&gt; function, but in most cases the result is a huge list.&lt;br /&gt;
Here is a simple detection method.&lt;br /&gt;
&lt;code&gt;$ python &lt;br /&gt;
Python 2.7.1 (r271:86832, Apr 12 2011, 16:16:18) &lt;br /&gt;
[GCC 4.6.0 20110331 (Red Hat 4.6.0-2)] on linux2&lt;br /&gt;
Type "help", "copyright", "credits" or "license" for more information.&lt;br /&gt;
&gt;&gt;&gt; import gnome &lt;br /&gt;
&gt;&gt;&gt; dirlist=dir(gnome)&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
I put content above command in a list.&lt;br /&gt;
We need to processed now.&lt;br /&gt;
&lt;code&gt;&gt;&gt;&gt; dirlist.index('ui')&lt;br /&gt;
Traceback (most recent call last):&lt;br /&gt;
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;&lt;br /&gt;
ValueError: 'ui' is not in list&lt;br /&gt;
&gt;&gt;&gt; dirlist.index('sound_play')&lt;br /&gt;
118&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
Here I found an item. To know something about it.&lt;br /&gt;
&lt;code&gt;&gt;&gt;&gt; help(dirlist[118])&lt;br /&gt;
no Python documentation found for 'sound_play'&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
Nothing about this. Let's use the command &lt;b&gt;dir&lt;/b&gt;.&lt;br /&gt;
&lt;code&gt;&gt;&gt;&gt; dir(dirlist[118])&lt;br /&gt;
['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '_formatter_field_name_split', '_formatter_parser', 'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
Using the examples above, you can create a script to parse this source code and check if the functions are the same as our version.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-8003265472275645891?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/AvvNKAr4KR_-Pq8A5ODAuiXzFDM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AvvNKAr4KR_-Pq8A5ODAuiXzFDM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/AvvNKAr4KR_-Pq8A5ODAuiXzFDM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AvvNKAr4KR_-Pq8A5ODAuiXzFDM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/Uq0DJpu-M_U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/8003265472275645891/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/09/tips-and-tricks-with-python.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/8003265472275645891?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/8003265472275645891?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/Uq0DJpu-M_U/tips-and-tricks-with-python.html" title="Tips and tricks with Python ..." /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><thr:total>0</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/09/tips-and-tricks-with-python.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEGQnY6eSp7ImA9WhdVGEU.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-728147197350605645</id><published>2011-09-24T10:50:00.000-07:00</published><updated>2011-09-24T10:50:23.811-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-24T10:50:23.811-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="gdata" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><title>Creating folders and documents with gdata module</title><content type="html">Today I played with gdata python module.&lt;br /&gt;
The problem that I solved it:&lt;br /&gt;
&lt;b&gt;creating folders and documents in your Gmail account.&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
First you need to install gdata module.&lt;br /&gt;
In fedora I used:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;yum install python-gdata.noarch &lt;/code&gt;&lt;/pre&gt;Here are the first lines of source code that creates a folder named &lt;b&gt;test-fedora&lt;/b&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;Python 2.7.1 (r271:86832, Apr 12 2011, 16:16:18) 
[GCC 4.6.0 20110331 (Red Hat 4.6.0-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import gdata.docs.service
&gt;&gt;&gt; my=gdata.docs.service.DocsService()
&gt;&gt;&gt; my.ClientLogin('your-account@gmail.com','your-password')
&gt;&gt;&gt; my.CreateFolder('test-fedora')
&lt;/code&gt;&lt;/pre&gt;I tried to automate the process of creating folders and I used a list and instruction &lt;b&gt;for&lt;/b&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;&gt;&gt;&gt; folders=['aaa','bbb','ccc']
&gt;&gt;&gt; for f in folders:
...     my.CreateFolder(f)
... 
&lt;/code&gt;&lt;/pre&gt;To create a document to write more lines of code.&lt;br /&gt;
This is because there are many types of documents&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;&gt;&gt;&gt; new_entry = gdata.GDataEntry()
&gt;&gt;&gt; new_entry.title = gdata.atom.Title(text='fedora-test')
&gt;&gt;&gt; category = my._MakeKindCategory(gdata.docs.service.DOCUMENT_LABEL)
&gt;&gt;&gt; new_entry.category.append(category)
&gt;&gt;&gt; created_entry = my.Post(new_entry, '/feeds/documents/private/full')
&lt;/code&gt;&lt;/pre&gt;Here's a simple solution to avoid loss of mail password.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;&gt;&gt;&gt; import getpass
&gt;&gt;&gt; username = raw_input('Please enter your username: ')
Please enter your username: user1
&gt;&gt;&gt; password = getpass.getpass()
Password: 
&gt;&gt;&gt; print username
user1
&gt;&gt;&gt; print password
pass1
&lt;/code&gt;&lt;/pre&gt;I hope you will use this&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-728147197350605645?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/f2BoJvIzu3X4bzzJ1iRfW-MWlG4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/f2BoJvIzu3X4bzzJ1iRfW-MWlG4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/f2BoJvIzu3X4bzzJ1iRfW-MWlG4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/f2BoJvIzu3X4bzzJ1iRfW-MWlG4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/4ezJq655XDY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/728147197350605645/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/09/creating-folders-and-documents-with.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/728147197350605645?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/728147197350605645?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/4ezJq655XDY/creating-folders-and-documents-with.html" title="Creating folders and documents with gdata module" /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><thr:total>0</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/09/creating-folders-and-documents-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUICQ3YyeSp7ImA9WhdQEUk.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-291075988889264437</id><published>2011-08-12T04:12:00.000-07:00</published><updated>2011-08-12T04:12:42.891-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-12T04:12:42.891-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="GLUT" /><category scheme="http://www.blogger.com/atom/ns#" term="fullscreen" /><category scheme="http://www.blogger.com/atom/ns#" term="opengl" /><title>GLUT - Creating a fullscreen applications.</title><content type="html">To create a fullscreen application must use the function: &lt;br /&gt;
&lt;b&gt;glutGameModeString()&lt;br /&gt;
glutEnterGameMode()&lt;/b&gt;&lt;br /&gt;
Below is the source commented.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;import sys
from OpenGL.GL import *
from OpenGL.GLUT import *

def main():
 
    # Initialize OpenGL
    glutInit(sys.argv)
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
 
    # Configure the display output
    glutGameModeString("1024x600:32@60")

    # The application will enter fullscreen
    glutEnterGameMode()
 
    # Setup callbacks for keyboard and display
    glutKeyboardFunc(keyboard)
    glutDisplayFunc(display)
 
    # Enters the GLUT event processing loop
    glutMainLoop()
 
def keyboard(key, x, y):
    if key == 'q':
        sys.exit(0)

def display():
    glClear(GL_COLOR_BUFFER_BIT)

    # Draw a green line
    glBegin(GL_LINES)
    glColor3f(0.0,100.0,0.0)
    glVertex2f(1.0, 1.0)
    glVertex2f(-1.0, -1.0)
    glEnd()
 
    glutSwapBuffers()
 
if __name__ == "__main__":
    main()&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-291075988889264437?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/k0cBpXcR0XdfLUAp5K6WY0HWpXk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/k0cBpXcR0XdfLUAp5K6WY0HWpXk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/k0cBpXcR0XdfLUAp5K6WY0HWpXk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/k0cBpXcR0XdfLUAp5K6WY0HWpXk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/Dei4BmYp8nU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/291075988889264437/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/08/creating-fullscreen-applications.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/291075988889264437?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/291075988889264437?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/Dei4BmYp8nU/creating-fullscreen-applications.html" title="GLUT - Creating a fullscreen applications." /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><thr:total>2</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/08/creating-fullscreen-applications.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUMGRn45eSp7ImA9WhdQEEU.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-3174129230305006967</id><published>2011-08-11T10:23:00.000-07:00</published><updated>2011-08-11T10:23:47.021-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-11T10:23:47.021-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="gtk" /><category scheme="http://www.blogger.com/atom/ns#" term="windows xp" /><category scheme="http://www.blogger.com/atom/ns#" term="glade" /><category scheme="http://www.blogger.com/atom/ns#" term="pygtk" /><title>How to make working pygtk with python 2.7</title><content type="html">As you know, PyGTK is a module that allows us to use the GTK interface.&lt;br /&gt;
A good start to use this module:&lt;br /&gt;
&lt;a href="http://www.pygtk.org/articles.html"&gt;Articles&lt;/a&gt;&lt;br /&gt;
I do not know if I presented this module on the site, but now I will try to present it.&lt;br /&gt;
First, as it says on the official site:&lt;br /&gt;
"PyGTK lets you easily create applications with a graphical user interface Using the Python programming language."&lt;br /&gt;
The second time is easy to use because we can easily create interfaces using Glade.&lt;br /&gt;
Glade is a RAD tool.&lt;br /&gt;
This development tool to let us create user interfaces for the GTK + toolkit and the GNOME desktop environment.&lt;br /&gt;
The output is an xml file which is then used by PyGTK.&lt;br /&gt;
Read more on the official site: &lt;a href="http://glade.gnome.org/"&gt;Glade RAD tool.&lt;/a&gt;&lt;br /&gt;
The tricky part is connecting with the python source code from the XML components.&lt;br /&gt;
You can download it here and install version 2.22 on Windows from &lt;a href="http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.22/"&gt;here&lt;/a&gt;.&lt;br /&gt;
I use &lt;b&gt;pygtk-all-in-one-2.22.6.win32-py2.7.msi&lt;/b&gt; to test pygtk.&lt;br /&gt;
Also, you need GTK  2.22 from &lt;a href="http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.22/gtk+-bundle_2.22.1-20101227_win32.zip"&gt;here&lt;/a&gt;.&lt;br /&gt;
How to make working Python 2.7 with GTK?&lt;br /&gt;
Just right-click on &lt;b&gt;My Computer&lt;/b&gt;, then select &lt;b&gt;Properties&lt;/b&gt;.&lt;br /&gt;
Click the &lt;b&gt;Advanced tab&lt;/b&gt; in the dialog that pops up, and click the &lt;b&gt;Environment Variables&lt;/b&gt; button near the bottom.&lt;br /&gt;
Under &lt;b&gt;System variables&lt;/b&gt;, click the &lt;b&gt;New&lt;/b&gt; button and enter &lt;b&gt;GTK_BASEPATH&lt;/b&gt;.&lt;br /&gt;
Now under variable named &lt;b&gt;Path&lt;/b&gt;, and click the &lt;b&gt;Edit&lt;/b&gt; button and add &lt;b&gt;GTK_BASEPATH\bin;&lt;/b&gt;.&lt;br /&gt;
Click the &lt;b&gt;OK&lt;/b&gt; buttons restart &lt;b&gt;Windows XP&lt;/b&gt;.&lt;br /&gt;
Now it is working fine with Python 2.7.&lt;br /&gt;
Let's try this script:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;#!/usr/bin/env python
import sys

try:
    import pygtk
    pygtk.require("2.0")
    print "pygtk 2.0 ok!"
except:
    print "pygtk 2.0 BAD!"
    pass
    
try:
    import gtk
    print "gtk ok!"
except:
    print "gtk BAD!"
    pass
&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-3174129230305006967?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/pM0VwVJmwaU6kO1qjFXTYpBK4kA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pM0VwVJmwaU6kO1qjFXTYpBK4kA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/pM0VwVJmwaU6kO1qjFXTYpBK4kA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pM0VwVJmwaU6kO1qjFXTYpBK4kA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/c1sgISkJj9Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/3174129230305006967/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/08/how-to-make-working-pygtk-with-python.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/3174129230305006967?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/3174129230305006967?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/c1sgISkJj9Y/how-to-make-working-pygtk-with-python.html" title="How to make working pygtk with python 2.7" /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><thr:total>0</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/08/how-to-make-working-pygtk-with-python.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU8AQXc4fip7ImA9WhdQEEQ.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-4566051645640458828</id><published>2011-08-11T10:14:00.000-07:00</published><updated>2011-08-11T14:24:00.936-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-11T14:24:00.936-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="GLUT" /><category scheme="http://www.blogger.com/atom/ns#" term="teapot" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="opengl" /><title>GLUT - teapot</title><content type="html">Using GLUT library is pretty simple if you know the operating mechanism.&lt;br /&gt;
&lt;blockquote&gt;GLUT (pronounced like the glut in gluttony) is the OpenGL Utility Toolkit, a window system independent toolkit for writing OpenGL programs. It implements a simple windowing application programming interface (API) for OpenGL. GLUT makes it considerably easier to learn about and explore OpenGL programming. GLUT provides a portable API so you can write a single OpenGL program that works across all PC and workstation OS platforms.&lt;/blockquote&gt;To work you need to install Python (I used version 2.7) and how PyOpenGL. You'll find it &lt;a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/"&gt;here&lt;/a&gt;.&lt;br /&gt;
The python module PyOpenGL provides bindings to OpenGL, GLUT, and GLE.&lt;br /&gt;
The necessary steps are:&lt;br /&gt;
1. initialize the GLUT library :glutInit function&lt;br /&gt;
2. sets the initial display mode with parameters set &lt;b&gt;GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH&lt;/b&gt;&lt;br /&gt;
3. initialization of the future windows with a given width/heightat a given width/height&lt;br /&gt;
4. Then the creation of four functions required to display, resizing, keyboard and display.These functions will be called in order to: &lt;b&gt;glutCreateWindow, glutReshapeFunc, glutKeyboardFunc, glutDisplayFunc&lt;/b&gt;.&lt;br /&gt;
5. calling these functions.&lt;br /&gt;
6. calling glutMainLoop to enter the GLUT event processing loop.&lt;br /&gt;
Here's source code.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;import sys
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *


def display():
    glEnable( GL_LIGHTING )
    glEnable( GL_LIGHT0 )
    glEnable( GL_DEPTH_TEST )

    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT )
    glPushMatrix()
    gluLookAt( 0,2.5,-7, 0,0,0, 0,1,0 )
    glutSolidTeapot( 2.5 )
    glPopMatrix()
    glFlush()

def reshape(w,h):
    glViewport( 0, 0, w, h )
    glMatrixMode( GL_PROJECTION )
    glLoadIdentity()
    gluPerspective( 45.0, 1.0*w/h, 0.1, 100.0 )
    glMatrixMode( GL_MODELVIEW )
    glLoadIdentity()

def keyboard(key,x,y):
    if key==chr(27): sys.exit(0)

glutInit( sys.argv )
glutInitDisplayMode( GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH )
glutInitWindowSize( 500, 400)
glutCreateWindow( 'teapot' )
glutReshapeFunc( reshape )
glutKeyboardFunc( keyboard )
glutDisplayFunc( display )
glutMainLoop()&lt;/code&gt;&lt;/pre&gt;Here's the result.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-9PnN2AKIAeI/TkQN5tPDpHI/AAAAAAAAKBQ/ONPTbU9ZErw/s1600/teapot.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="188" width="320" src="http://4.bp.blogspot.com/-9PnN2AKIAeI/TkQN5tPDpHI/AAAAAAAAKBQ/ONPTbU9ZErw/s320/teapot.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;You can read more in the &lt;a href="http://www.opengl.org/documentation/specs/glut/spec3/spec3.html"&gt;documentation&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-4566051645640458828?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/sbmfrWLHtLw4AXx3UtFt7LwSUVI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sbmfrWLHtLw4AXx3UtFt7LwSUVI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/sbmfrWLHtLw4AXx3UtFt7LwSUVI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sbmfrWLHtLw4AXx3UtFt7LwSUVI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/uwe-Ykz61D0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/4566051645640458828/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/08/glut-teapot.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/4566051645640458828?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/4566051645640458828?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/uwe-Ykz61D0/glut-teapot.html" title="GLUT - teapot" /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-9PnN2AKIAeI/TkQN5tPDpHI/AAAAAAAAKBQ/ONPTbU9ZErw/s72-c/teapot.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/08/glut-teapot.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkEHR3Y8fCp7ImA9WhdRF08.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-3842970938490605256</id><published>2011-08-07T06:43:00.000-07:00</published><updated>2011-08-07T06:43:56.874-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-07T06:43:56.874-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="error" /><category scheme="http://www.blogger.com/atom/ns#" term="numpy" /><category scheme="http://www.blogger.com/atom/ns#" term="Numeric" /><title>Python errors: numpy vs. Numeric</title><content type="html">&lt;p&gt;Today I decided to clarify some of the error that we met and I found a solution.&lt;/p&gt;&lt;p&gt;I created a new series called: &lt;b&gt;Python errors&lt;/b&gt;&lt;/p&gt;&lt;p&gt;The first error occurs in trying to run scripts that require Numeric module.&lt;/p&gt;&lt;p&gt;You can run python 2.7 with numpy. But the Numeric module is not available in python 2.7 .&lt;/p&gt;&lt;p&gt;Such a script will try to import module:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;import Numeric&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;and the next step will be something like:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
s = Numeric.zeros((N,N),Numeric.Float32)
...
s = Numeric.zeros((N,N),Numeric.Int32)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The first error is :&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    import Numeric
ImportError: No module named Numeric&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now , if you change from &lt;b&gt;Numeric&lt;/b&gt; in &lt;b&gt;numpy&lt;/b&gt; then you got this error:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    ... = numpy.zeros( (N,N),numpy.Float32 )
AttributeError: 'module' object has no attribute 'Float32'&lt;/code&gt;&lt;/pre&gt;To working well, just use this :&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;numpy.zeros( (N,N),float)
numpy.zeros( (N,N), int)&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Actually, should be replaced :&lt;/p&gt;&lt;pre&gt;&lt;code&gt;numpy.Float32&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;with&lt;/p&gt;&lt;pre&gt;&lt;code&gt;float&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The same applies for Int32 .&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-3842970938490605256?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/HiqOePLBY15UjC2cN-BxMDxkcV0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HiqOePLBY15UjC2cN-BxMDxkcV0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/HiqOePLBY15UjC2cN-BxMDxkcV0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HiqOePLBY15UjC2cN-BxMDxkcV0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/Dhr3K1v9ElA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/3842970938490605256/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/08/python-errors-numpy-vs-numeric.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/3842970938490605256?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/3842970938490605256?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/Dhr3K1v9ElA/python-errors-numpy-vs-numeric.html" title="Python errors: numpy vs. Numeric" /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><thr:total>0</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/08/python-errors-numpy-vs-numeric.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A04CQX08eyp7ImA9WhdRFUk.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-3322937952500668435</id><published>2011-08-05T06:12:00.000-07:00</published><updated>2011-08-05T06:12:40.373-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-05T06:12:40.373-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="pygame" /><category scheme="http://www.blogger.com/atom/ns#" term="2.7" /><category scheme="http://www.blogger.com/atom/ns#" term="xp" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><title>Installing and using pygame module in Windows XP.</title><content type="html">&lt;p&gt;You must have one of these versions of python installed:&lt;/p&gt;&lt;p&gt;&lt;b&gt;2.6 , 2.7 , 3.1 or 3.2&lt;/b&gt;&lt;/p&gt;&lt;p&gt;... 32 bits or 64 bits.&lt;/p&gt;&lt;p&gt;Take the version you need from &lt;a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame"&gt;here.&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Just run the executable and it will automatically install the python.&lt;/p&gt;&lt;p&gt;You can check if it runs:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;python
Python 2.7 (r27:82525, Jul  4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import pygame
&gt;&gt;&gt; from pygame import *&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;On the same site you can find other modules required. You can try them.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-3322937952500668435?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/oGfzDLqQKX0fA2TdIUL-fwYtQCI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oGfzDLqQKX0fA2TdIUL-fwYtQCI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/oGfzDLqQKX0fA2TdIUL-fwYtQCI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oGfzDLqQKX0fA2TdIUL-fwYtQCI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/rgai0P1Qxbc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/3322937952500668435/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/08/installing-and-using-pygame-module-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/3322937952500668435?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/3322937952500668435?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/rgai0P1Qxbc/installing-and-using-pygame-module-in.html" title="Installing and using pygame module in Windows XP." /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><thr:total>0</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/08/installing-and-using-pygame-module-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UFRnwzfip7ImA9WhZUEks.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-4816073815568133761</id><published>2011-06-05T03:20:00.000-07:00</published><updated>2011-06-05T03:20:17.286-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-05T03:20:17.286-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="pyparsing" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="module" /><title>An alternative for parsing - the pyparsing module</title><content type="html">First download the package from &lt;a href="http://pyparsing.wikispaces.com/Download+and+Installation"&gt;here&lt;/a&gt;, unzip and run the installation command:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;C:\pyparsing-1.5.5&gt;python setup.py install
running install
running build
running build_py
creating build
creating build\lib
copying pyparsing.py -&gt; build\lib
running install_lib
copying build\lib\pyparsing.py -&gt; C:\Python27\Lib\site-packages
byte-compiling C:\Python27\Lib\site-packages\pyparsing.py to pyparsing.pyc
running install_egg_info
Writing C:\Python27\Lib\site-packages\pyparsing-1.5.5-py2.7.egg-info
&lt;/code&gt;&lt;/pre&gt;From the official site we find that:&lt;br /&gt;
&lt;blockquote&gt;The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions. The pyparsing module provides a library of classes that client code uses to construct the grammar directly in Python code.&lt;br /&gt;
&lt;/blockquote&gt;The package comes with a number of examples that illustrate the flexibility of this module.&lt;br /&gt;
This file format is used by ICal on the Macintosh and in the Mozilla Calendar project. I think that can be imported into google calendar.&lt;br /&gt;
&lt;br /&gt;
They can be found &lt;a href="http://pyparsing.wikispaces.com/Examples"&gt;here&lt;/a&gt;.&lt;br /&gt;
Of these I particularly liked the example for parsing files with extension &lt;b&gt;ics&lt;/b&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-4816073815568133761?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KuTnYoaWgG3qidtR1YZInWubjfY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KuTnYoaWgG3qidtR1YZInWubjfY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KuTnYoaWgG3qidtR1YZInWubjfY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KuTnYoaWgG3qidtR1YZInWubjfY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/QU9q2We0M0Q" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/4816073815568133761/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/06/alternative-for-parsing-pyparsing.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/4816073815568133761?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/4816073815568133761?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/QU9q2We0M0Q/alternative-for-parsing-pyparsing.html" title="An alternative for parsing - the pyparsing module" /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><thr:total>0</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/06/alternative-for-parsing-pyparsing.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMGQXk8fSp7ImA9WhZQE0Q.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-740745396751347476</id><published>2011-04-21T08:07:00.000-07:00</published><updated>2011-04-21T08:07:00.775-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-21T08:07:00.775-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="merlin" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="win32com" /><category scheme="http://www.blogger.com/atom/ns#" term="module" /><title>Python and Merlin , using win32com module.</title><content type="html">I remembered my days when I played with visual script.&lt;br /&gt;
Later I discovered python on linux and I realized that it's as good if not better.&lt;br /&gt;
Then I made ​​a script that display the character Merlin said something.&lt;br /&gt;
Today I'll try the same thing with python.&lt;br /&gt;
First you have to install python module called &lt;b&gt;win32com&lt;/b&gt;.&lt;br /&gt;
For this we use installer from &lt;a href="file:///C:/Documents%20and%20Settings/Nicoleta/My%20Documents/Downloads/pywin32-216.win32-py2.6.exe"&gt;here&lt;/a&gt;.&lt;br /&gt;
It automatically installs python 2.6 folder, see picture below...&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-qTBzAT3uM_g/TbA4atWMiLI/AAAAAAAAJT0/yiHGuu0dvrw/s1600/pywin32-216.JPG" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="187" width="320" src="http://1.bp.blogspot.com/-qTBzAT3uM_g/TbA4atWMiLI/AAAAAAAAJT0/yiHGuu0dvrw/s320/pywin32-216.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;To begin to build script.&lt;br /&gt;
For this we need to read the MSDN documentation least, see &lt;a href="http://msdn.microsoft.com/en-us/library/ms695804.aspx"&gt;here&lt;/a&gt;.&lt;br /&gt;
The first step required is to import module module ...&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;import win32com
from win32com import client
from win32com.client import constants
&lt;/code&gt;&lt;/pre&gt;Access file .acs and declare a variable named &lt;b&gt;vrajitor&lt;/b&gt; to use it.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;agent = win32com.client.Dispatch("Agent.Control.2")
agent.Connected = -1
agent.Characters.Load("Merlin", "Merlin.acs")
vrajitor= agent.Characters("Merlin")&lt;/code&gt;&lt;/pre&gt;Now we can use its methods for animation and not only ...&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;vrajitor .LanguageID = 0x409
vrajitor .Show()
vrajitor .Play("Announce")
vrajitor .Speak("I like to use Python programming language!")
vrajitor .Speak("... and I'm really good. See!?")
vrajitor .Play("Congratulate")
print "Type some commands! (max 99 comands)"
print "Congratulate, Acknowledge, Blink, Confused, Decline, Explain"
for i in range(100):
 cmd=raw_input()
 print cmd
 vrajitor .Play(cmd)&lt;/code&gt;&lt;/pre&gt;Here's the result ...&lt;br /&gt;
&lt;iframe src="http://player.vimeo.com/video/22702143?title=0&amp;amp;byline=0&amp;amp;portrait=0" width="400" height="267" frameborder="0"&gt;&lt;/iframe&gt;&lt;p&gt;&lt;a href="http://vimeo.com/22702143"&gt;merlin python&lt;/a&gt; from &lt;a href="http://vimeo.com/user555937"&gt;Catalin Festila&lt;/a&gt; on &lt;a href="http://vimeo.com"&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-740745396751347476?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eCyk3faPfBsql73RB4w-pQXv72Y/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eCyk3faPfBsql73RB4w-pQXv72Y/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eCyk3faPfBsql73RB4w-pQXv72Y/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eCyk3faPfBsql73RB4w-pQXv72Y/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/0c3crw4oZhw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/740745396751347476/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/04/python-and-merlin-using-win32com-module.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/740745396751347476?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/740745396751347476?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/0c3crw4oZhw/python-and-merlin-using-win32com-module.html" title="Python and Merlin , using win32com module." /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-qTBzAT3uM_g/TbA4atWMiLI/AAAAAAAAJT0/yiHGuu0dvrw/s72-c/pywin32-216.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/04/python-and-merlin-using-win32com-module.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4MRn86fCp7ImA9WhZQE00.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-3154484487308187435</id><published>2011-04-20T05:53:00.000-07:00</published><updated>2011-04-20T05:53:07.114-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-20T05:53:07.114-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="picasa" /><category scheme="http://www.blogger.com/atom/ns#" term="gdata" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="module" /><title>Using google account using gdata python module - Picasa Web Albums.</title><content type="html">The first step, the installation is the same as &lt;a href="http://python-catalin.blogspot.com/2011/04/pyopengl-and-pyopengl-accelerate-301.html"&gt;here&lt;/a&gt;.&lt;br /&gt;
You can check if the gdata module is installed by running the following source code"&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
&amp;gt;&amp;gt;&amp;gt; import gdata
&amp;gt;&amp;gt;&amp;gt; from gdata import *
&lt;/code&gt;&lt;/pre&gt;Now I will show you which modules you can use the gdata.&lt;br /&gt;
For this you can use:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
&amp;gt;&amp;gt;&amp;gt;help(gdata)
...
PACKAGE CONTENTS
    Crypto (package)
    acl (package)
    alt (package)
    analytics (package)
    apps (package)
    apps_property
    auth
    base (package)
    blogger (package)
    books (package)
    calendar (package)
    calendar_resource (package)
    client
    codesearch (package)
    contacts (package)
    core
    data
    docs (package)
    dublincore (package)
    exif (package)
    finance (package)
    gauth
    geo (package)
    health (package)
    media (package)
    notebook (package)
    oauth (package)
    opensearch (package)
    photos (package)
    projecthosting (package)
    sample_util
    service
    sites (package)
    spreadsheet (package)
    spreadsheets (package)
    test_config
    test_data
    tlslite (package)
    urlfetch
    webmastertools (package)
    youtube (package)
&lt;/code&gt;&lt;/pre&gt;Let's try to connect to Picasa.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
&amp;gt;&amp;gt;&amp;gt; from gdata import photos
&amp;gt;&amp;gt;&amp;gt; from gdata.photos import  service
&lt;/code&gt;&lt;/pre&gt;If you try to import directly, you get an error. See:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
&amp;gt;&amp;gt;&amp;gt; client = gdata.photos.service.PhotosService()
Traceback (most recent call last):
...
AttributeError: 'module' object has no attribute 'photos'
&amp;gt;&amp;gt;&amp;gt; from gdata import photos
&amp;gt;&amp;gt;&amp;gt; client = gdata.photos.service.PhotosService()
Traceback (most recent call last):
...
AttributeError: 'module' object has no attribute 'service'
&lt;/code&gt;&lt;/pre&gt;To use the gdata module google account you need to use two lines of source code above.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
&amp;gt;&amp;gt;&amp;gt; user="your_account"
&amp;gt;&amp;gt;&amp;gt; passwd="your_password"
&lt;/code&gt;&lt;/pre&gt;Then you must login with google account username and password.&lt;br /&gt;
There are two ways to connect:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;single-user "installed" client authentication&lt;/li&gt;
&lt;li&gt;multiple-user web application client authentication&lt;/li&gt;
&lt;/ol&gt;We will use the first, also called "Authentication for Installed Applications"&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
&amp;gt;&amp;gt;&amp;gt; client = gdata.photos.service.PhotosService()
&amp;gt;&amp;gt;&amp;gt; client.source = 'api-sample-google-com'
&amp;gt;&amp;gt;&amp;gt; client.email=user
&amp;gt;&amp;gt;&amp;gt; client.password=passwd
&amp;gt;&amp;gt;&amp;gt; client.ProgrammaticLogin()
&lt;/code&gt;&lt;/pre&gt;Let's see what albums we have on account picasa.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
&amp;gt;&amp;gt;&amp;gt; albums = client.GetUserFeed()
&amp;gt;&amp;gt;&amp;gt; for album in albums.entry:
...   print 'title: %s, number of photos: %s, id: %s' % (album.title.text,
...       album.numphotos.text, album.gphoto_id.text)
...
title: First your album
&lt;/code&gt;&lt;/pre&gt;We may try to download one of them ...&lt;br /&gt;
We will import additional modules.&lt;br /&gt;
Urllib module to access the image url.&lt;br /&gt;
Os and sys modules to create and save images.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; import urllibb
&amp;gt;&amp;gt;&amp;gt; import os
&amp;gt;&amp;gt;&amp;gt; import sys
&lt;/code&gt;&lt;/pre&gt;Check if folder &lt;i&gt;album&lt;/i&gt; exists, if not will create it.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
&amp;gt;&amp;gt;&amp;gt; folder_album="album"
&amp;gt;&amp;gt;&amp;gt; if not os.path.exists( folder_album ):
...     os.makedirs( folder_album )
...
&lt;/code&gt;&lt;/pre&gt;The following source code is to download images in the folder.&lt;br /&gt;
It is a bit more complex to understand, but not impossible.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; allphotos = client.GetFeed('/data/feed/api/user/default/albumid/%s?kind=photo' % (album.gphoto_id.text))
&amp;gt;&amp;gt;&amp;gt; for photo in allphotos.entry:
...     filename= photo.content.src[photo.content.src.rindex('/') + 1:]
...     urllib.urlretrieve(photo.content.src, folder_album+"/"+filename)
...     sys.stdout.write(filename)
...     sys.stdout.flush()
...
('album/sssss.JPG', &amp;lt;httplib.HTTPMessage instance at ...&lt;/code&gt;&lt;/pre&gt;If you check the folder where to start or run the python script, we have a folder with images in our album.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-3154484487308187435?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Bwgha70hJl_28Vv8MacCVCcXuCs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Bwgha70hJl_28Vv8MacCVCcXuCs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Bwgha70hJl_28Vv8MacCVCcXuCs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Bwgha70hJl_28Vv8MacCVCcXuCs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/kNu0oCdTQVo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/3154484487308187435/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/04/using-google-account-using-gdata-python.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/3154484487308187435?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/3154484487308187435?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/kNu0oCdTQVo/using-google-account-using-gdata-python.html" title="Using google account using gdata python module - Picasa Web Albums." /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><thr:total>0</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/04/using-google-account-using-gdata-python.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEIERXg4fSp7ImA9WhZQEUQ.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-5709193926249415647</id><published>2011-04-19T00:01:00.000-07:00</published><updated>2011-04-19T00:01:44.635-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-19T00:01:44.635-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="&quot;tips and tricks&quot;" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><title>Things that prevent complications ... part 1</title><content type="html">&lt;b&gt;The difference between ... input and raw_input&lt;/b&gt;&lt;br /&gt;
input returns an object that's the result of evaluating the expression. raw_input returns a string ...&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;The difference between ... Python 3 and Python 2&lt;/b&gt;&lt;br /&gt;
If you run the Python 3, do not use sample code written for Python 2, you'll just end with many errors and much confusion ...&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;The difference between ... extend and append on a list&lt;/b&gt;&lt;br /&gt;
Extend just extend a list with another list by adding each element on list, append add the list like one element... &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;The difference between ... function and method&lt;/b&gt;&lt;br /&gt;
Method is a function with an extra parameter which is the object that it's to run on...&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;The difference between ... deleting a variable and deleting its contents&lt;/b&gt;&lt;br /&gt;
By removing its contents by setting NoneType variable allows you to add a new value.&lt;br /&gt;
&lt;br /&gt;
These are just a few differences, in reality they are much more ... I will return with others ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-5709193926249415647?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/rQ48pdLY55dE1tQskitN_Jrpqo8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rQ48pdLY55dE1tQskitN_Jrpqo8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/rQ48pdLY55dE1tQskitN_Jrpqo8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rQ48pdLY55dE1tQskitN_Jrpqo8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/HLts_cpr6BI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/5709193926249415647/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/04/things-that-prevent-complications-part.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/5709193926249415647?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/5709193926249415647?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/HLts_cpr6BI/things-that-prevent-complications-part.html" title="Things that prevent complications ... part 1" /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><thr:total>0</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/04/things-that-prevent-complications-part.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU8BRHw_eyp7ImA9WhZRGUo.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-8414507350617406098</id><published>2011-04-16T11:17:00.000-07:00</published><updated>2011-04-16T11:17:35.243-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-16T11:17:35.243-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="xp" /><category scheme="http://www.blogger.com/atom/ns#" term="opengl" /><category scheme="http://www.blogger.com/atom/ns#" term="module" /><title>PyOpenGL and PyOpenGL-accelerate  3.0.1 - latest version</title><content type="html">First , the major error is this:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-70TdTQhFlHY/TanU6fes-kI/AAAAAAAAJK8/yssOXhzKyS8/s1600/pyopengl30-err.JPG" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="76" width="400" src="http://1.bp.blogspot.com/-70TdTQhFlHY/TanU6fes-kI/AAAAAAAAJK8/yssOXhzKyS8/s400/pyopengl30-err.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;I try fix this with ... NetFx20SP2_x86.exe, not working.&lt;br /&gt;
I use google to donload the dll file. Is not correct way , but this fix error.&lt;br /&gt;
I use this PyOpenGL-3.0.1.zip to install OpenGL module under Python 2.6.2 ...&lt;br /&gt;
Just use this :&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;python setup.py install&lt;/code&gt;&lt;/pre&gt;But you can not use python on command line, because you need to add on enviroment vars...&lt;br /&gt;
Just try something like this...&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;C:\&gt;set PATH=C:\Python26;%PATH%&lt;/code&gt;&lt;/pre&gt;To see the result , just use:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;C:\path&lt;/code&gt;&lt;/pre&gt;You can test the OpenGL modules...&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;&gt;&gt;&gt; import OpenGL
&gt;&gt;&gt; import OpenGL_accelerate
&gt;&gt;&gt; help(OpenGL_accelerate)
Help on package OpenGL_accelerate:

NAME
    OpenGL_accelerate - Cython-coded accelerators for the PyOpenGL wrapper

FILE
    c:\python26\lib\site-packages\opengl_accelerate\__init__.py

DESCRIPTION
    This package contains Cython accelerator modules which
    attempt to speed up certain aspects of the PyOpenGL 3.x
    wrapper mechanism.  The source code is part of the
    PyOpenGL package and is built via the setupaccel.py
    script in the top level of the PyOpenGL source package.

PACKAGE CONTENTS
    arraydatatype
    errorchecker
    formathandler
    latebind
    nones_formathandler
    numpy_formathandler
    vbo
    wrapper
-- More  --&lt;/code&gt;&lt;/pre&gt;This is all .&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-8414507350617406098?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Nc4YH2Y7L6znAnY1Yi26J-kNLnA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Nc4YH2Y7L6znAnY1Yi26J-kNLnA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Nc4YH2Y7L6znAnY1Yi26J-kNLnA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Nc4YH2Y7L6znAnY1Yi26J-kNLnA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/m_Xpfwxhadw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/8414507350617406098/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/04/pyopengl-and-pyopengl-accelerate-301.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/8414507350617406098?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/8414507350617406098?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/m_Xpfwxhadw/pyopengl-and-pyopengl-accelerate-301.html" title="PyOpenGL and PyOpenGL-accelerate  3.0.1 - latest version" /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-70TdTQhFlHY/TanU6fes-kI/AAAAAAAAJK8/yssOXhzKyS8/s72-c/pyopengl30-err.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/04/pyopengl-and-pyopengl-accelerate-301.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D04CSXc4fip7ImA9WhZRGUs.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-1750942090195147319</id><published>2011-04-16T07:59:00.000-07:00</published><updated>2011-04-16T07:59:28.936-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-16T07:59:28.936-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="logging" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="module" /><title>Logging documentation for Python 2.7 reorganised like Python 3</title><content type="html">First , what is logging module ?&lt;br /&gt;
&lt;blockquote&gt;&lt;i&gt;This module defines functions and classes which implement a flexible event logging system for applications and libraries.&lt;/i&gt;&lt;/blockquote&gt;The organisation is now as follows:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;http://docs.python.org/library/logging – reference documentation for the logging module&lt;/li&gt;
&lt;li&gt;http://docs.python.org/library/logging.config - reference documentation for the logging.config module&lt;/li&gt;
&lt;li&gt;http://docs.python.org/library/logging.handlers - reference documentation for the logging.handlers module&lt;/li&gt;
&lt;li&gt;http://docs.python.org/howto/logging – basic and advanced logging tutorials&lt;/li&gt;
&lt;li&gt;http://docs.python.org/howto/logging-cookbook – how to use logging in different scenarios&lt;/li&gt;
&lt;/ul&gt;The best way to understand this module  is to see the tutorials...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-1750942090195147319?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/uto8AJd2w_t1S2mfWxsl7gJGhFY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uto8AJd2w_t1S2mfWxsl7gJGhFY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/uto8AJd2w_t1S2mfWxsl7gJGhFY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uto8AJd2w_t1S2mfWxsl7gJGhFY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/bJ3Qb3WPIaQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/1750942090195147319/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/04/logging-documentation-for-python-27.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/1750942090195147319?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/1750942090195147319?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/bJ3Qb3WPIaQ/logging-documentation-for-python-27.html" title="Logging documentation for Python 2.7 reorganised like Python 3" /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><thr:total>0</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/04/logging-documentation-for-python-27.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QGSHw_fCp7ImA9WhZREUU.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-1323017233892539347</id><published>2011-04-07T08:15:00.000-07:00</published><updated>2011-04-07T08:15:29.244-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-07T08:15:29.244-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="modules" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><title>Using modules in Python 3.2</title><content type="html">Python is quite known and appreciated.&lt;br /&gt;
Today I saw an article "What's your favorite programming language?" LinuxWeek proncetaj of a 26% (1074 votes) ...&lt;br /&gt;
In python "module" which is actually a library.&lt;br /&gt;
Using it is simple: import "module name"&lt;br /&gt;
See example below:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
import os
&lt;/code&gt;&lt;/pre&gt;There are many modules in the Python language. &lt;br /&gt;
For example I chose an example of how to display modules that are installed. Open the python command line and run the examples below:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
C:\Python32&gt;python
Python 3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; help('modules')

Please wait a moment while I gather a list of all available modules...

__future__          audioop             imp                 shlex
_abcoll             base64              importlib           shutil
_ast                bdb                 inspect             signal
_bisect             binascii            io                  site
_codecs             binhex              itertools           smtpd
_codecs_cn          bisect              json                smtplib
_codecs_hk          builtins            keyword             sndhdr
_codecs_iso2022     bz2                 lib2to3             socket
_codecs_jp          cProfile            linecache           socketserver
_codecs_kr          calendar            locale              sqlite3
_codecs_tw          cgi                 logging             sre_compile
_collections        cgitb               macpath             sre_constants
_compat_pickle      chunk               macurl2path         sre_parse
_csv                cmath               mailbox             ssl
_ctypes             cmd                 mailcap             stat
_ctypes_test        code                marshal             string
_datetime           codecs              math                stringprep
_dummy_thread       codeop              mimetypes           struct
_elementtree        collections         mmap                subprocess
_functools          colorsys            modulefinder        sunau
_hashlib            compileall          msilib              symbol
_heapq              concurrent          msvcrt              symtable
_io                 configparser        multiprocessing     sys
_json               contextlib          netrc               sysconfig
_locale             copy                nntplib             tabnanny
_lsprof             copyreg             nt                  tarfile
_markupbase         csv                 ntpath              telnetlib
_md5                ctypes              nturl2path          tempfile
_msi                curses              numbers             test
_multibytecodec     datetime            opcode              textwrap
_multiprocessing    dbm                 operator            this
_pickle             decimal             optparse            threading
_pyio               difflib             os                  time
_random             dis                 os2emxpath          timeit
_sha1               distutils           parser              tkinter
_sha256             doctest             pdb                 token
_sha512             dummy_threading     pickle              tokenize
_socket             email               pickletools         trace
_sqlite3            encodings           pipes               traceback
_sre                errno               pkgutil             tty
_ssl                filecmp             platform            turtle
_string             fileinput           plistlib            turtledemo
_strptime           fnmatch             poplib              types
_struct             formatter           posixpath           unicodedata
_subprocess         fractions           pprint              unittest
_symtable           ftplib              profile             urllib
_testcapi           functools           pstats              uu
_thread             gc                  pty                 uuid
_threading_local    gdata               py_compile          warnings
_tkinter            genericpath         pyclbr              wave
_warnings           getopt              pydoc               weakref
_weakref            getpass             pydoc_data          webbrowser
_weakrefset         gettext             pyexpat             winreg
abc                 glob                queue               winsound
aifc                gzip                quopri              wsgiref
antigravity         hashlib             random              xdrlib
argparse            heapq               re                  xml
array               hmac                reprlib             xmlrpc
ast                 html                rlcompleter         xxsubtype
asynchat            http                runpy               zipfile
asyncore            idlelib             sched               zipimport
atexit              imaplib             select              zlib
atom                imghdr              shelve

Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose descriptions contain the word "spam".

&gt;&gt;&gt; dir('module')
['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__
format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__gt_
_', '__hash__', '__init__', '__iter__', '__le__', '__len__', '__lt__', '__mod__'
, '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__
rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
 'capitalize', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'f
ormat', 'format_map', 'index', 'isalnum', 'isalpha', 'isdecimal', 'isdigit', 'is
identifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupp
er', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace', 'r
find', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines
', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
&gt;&gt;&gt; exit()
&lt;/code&gt;&lt;/pre&gt;This is just another example of how to use python.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-1323017233892539347?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/VYBRG8qdPsCB5WBUA_0bEbMKLPg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VYBRG8qdPsCB5WBUA_0bEbMKLPg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/VYBRG8qdPsCB5WBUA_0bEbMKLPg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VYBRG8qdPsCB5WBUA_0bEbMKLPg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/frrZRCd_WsM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/1323017233892539347/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/04/using-modules-in-python-32.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/1323017233892539347?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/1323017233892539347?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/frrZRCd_WsM/using-modules-in-python-32.html" title="Using modules in Python 3.2" /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><thr:total>0</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/04/using-modules-in-python-32.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0AFQX4zfyp7ImA9WhZSEEg.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-7480537222203502825</id><published>2011-03-25T04:15:00.000-07:00</published><updated>2011-03-25T04:15:10.087-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-25T04:15:10.087-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="PyGUI" /><category scheme="http://www.blogger.com/atom/ns#" term="GUI" /><title>PyGUI 2.4 is available from</title><content type="html">PyGUI is a cross-platform GUI toolkit designed to be lightweight and have a highly Pythonic API.&lt;br /&gt;
It's works with Python 3 on MacOSX and Windows.&lt;br /&gt;
You use the OpenGL facilities but you will need PyOpenGL and GtkGLExt and PyGtkGLExt.&lt;br /&gt;
Official site is &lt;a href="http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/"&gt;here&lt;/a&gt;.&lt;br /&gt;
In this image you can see some controls created with PyGUI.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://4.bp.blogspot.com/-hEZPjDGsMLw/TYx4v60Oz1I/AAAAAAAAI8E/NmY5MDBf1Yk/s1600/PyGUI.jpg" imageanchor="1" style=""&gt;&lt;img border="0" height="299" width="338" src="http://4.bp.blogspot.com/-hEZPjDGsMLw/TYx4v60Oz1I/AAAAAAAAI8E/NmY5MDBf1Yk/s400/PyGUI.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=pythoncatalin-20&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=0596158106&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;"align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=pythoncatalin-20&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=0905705874&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;"align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-7480537222203502825?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/tZWIihi0Xt-i9GTV1LtAehoSugs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tZWIihi0Xt-i9GTV1LtAehoSugs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/tZWIihi0Xt-i9GTV1LtAehoSugs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tZWIihi0Xt-i9GTV1LtAehoSugs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/segIA_NHx7c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/7480537222203502825/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/03/pygui-24-is-available-from.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/7480537222203502825?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/7480537222203502825?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/segIA_NHx7c/pygui-24-is-available-from.html" title="PyGUI 2.4 is available from" /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-hEZPjDGsMLw/TYx4v60Oz1I/AAAAAAAAI8E/NmY5MDBf1Yk/s72-c/PyGUI.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/03/pygui-24-is-available-from.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0cERn8ycCp7ImA9WhZTGE8.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-3486319539698355520</id><published>2011-03-22T14:23:00.000-07:00</published><updated>2011-03-22T14:23:27.198-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-22T14:23:27.198-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio" /><title>Python Tools for Visual Studio</title><content type="html">I just read that python will be placed in the tools in Visual Studio.&lt;br /&gt;
This can only be good news for the python community.&lt;br /&gt;
More about this &lt;a href="http://pytools.codeplex.com/"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;iframe src="http://rcm.amazon.com/e/cm?t=pythoncatalin-20&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=0596158068&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;"align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=pythoncatalin-20&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=B002L6GJ9M&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;"align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-3486319539698355520?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9CXKimJIzFNpmbh4ZtFaR7eyQis/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9CXKimJIzFNpmbh4ZtFaR7eyQis/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9CXKimJIzFNpmbh4ZtFaR7eyQis/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9CXKimJIzFNpmbh4ZtFaR7eyQis/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/CYvDSpy1JhY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/3486319539698355520/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/03/python-tools-for-visual-studio.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/3486319539698355520?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/3486319539698355520?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/CYvDSpy1JhY/python-tools-for-visual-studio.html" title="Python Tools for Visual Studio" /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><thr:total>0</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/03/python-tools-for-visual-studio.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkIDQH88fCp7ImA9WhZTFkQ.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-2596943884598097344</id><published>2011-03-21T02:09:00.000-07:00</published><updated>2011-03-21T02:09:31.174-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-21T02:09:31.174-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="penguin" /><title>The discovery of an ancient ancestors linux ...</title><content type="html">Who says penguins are weak? &lt;br /&gt;
Linux is a good system if it is used by smart people. &lt;br /&gt;
Since ancient times people are born with penguins.&lt;br /&gt;
It seems that dinosaurs could not survive, but the Penguins have managed well.&lt;br /&gt;
They became smaller but everyone loves them.&lt;br /&gt;
Whether they are small and fast as gentoo, or slower ... we are glad that we have no windows open.&lt;br /&gt;
More infos &lt;a href="http://www.newser.com/story/101901/giant-penguin-fossil-found-in-peru.html"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-2596943884598097344?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/b-m2ziFlBwtoE2CoBDm5mprE494/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/b-m2ziFlBwtoE2CoBDm5mprE494/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/b-m2ziFlBwtoE2CoBDm5mprE494/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/b-m2ziFlBwtoE2CoBDm5mprE494/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/BAiSdpdt-74" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/2596943884598097344/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/03/discovery-of-ancient-ancestors-linux.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/2596943884598097344?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/2596943884598097344?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/BAiSdpdt-74/discovery-of-ancient-ancestors-linux.html" title="The discovery of an ancient ancestors linux ..." /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><thr:total>0</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/03/discovery-of-ancient-ancestors-linux.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkIHSX09fyp7ImA9WhZTEEQ.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-4452182640885980136</id><published>2011-03-14T02:20:00.000-07:00</published><updated>2011-03-14T02:22:18.367-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-14T02:22:18.367-07:00</app:edited><title>IronPython released on 12 and updated on 13 march.</title><content type="html">&lt;b&gt;What is it?&lt;/b&gt;&lt;br /&gt;
IronPython is an implementation of the Python programming language and is  running under .NET and Silverlight.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;How does it work?&lt;/b&gt;&lt;br /&gt;
When you run a .NET program written in a language such as C# or VB.NET, your code gets compiled to Intermediate Language (IL) code. &lt;br /&gt;
IronPython contains the code and classes for IronPython itself, including the IronPython interpreter. When you run the IronPython interpreter, you are running the IL code for IronPython itself.&lt;br /&gt;
More simplistic, the classes you create in your Python code are created dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;What's New?&lt;/b&gt;&lt;br /&gt;
This release numerous bug fixes, also includes a &lt;b&gt;IronPython Tools for Visual Studio&lt;/b&gt;, support for extension methods and more...&lt;br /&gt;
&lt;i&gt;You can see more on official &lt;a href="http://ironpython.codeplex.com/"&gt;site&lt;/a&gt;&lt;/i&gt;.&lt;br /&gt;
&lt;iframe src="http://rcm.amazon.com/e/cm?t=pythoncatalin-20&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=1933988339&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;"align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=pythoncatalin-20&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=B003JTHYUI&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;"align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-4452182640885980136?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/wVWT6g1YRbI-XQ_xX5qWRgCq7Ks/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wVWT6g1YRbI-XQ_xX5qWRgCq7Ks/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/wVWT6g1YRbI-XQ_xX5qWRgCq7Ks/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wVWT6g1YRbI-XQ_xX5qWRgCq7Ks/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/PBHcH_-SDLc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/4452182640885980136/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/03/ironpython-released-on-12-and-updated.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/4452182640885980136?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/4452182640885980136?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/PBHcH_-SDLc/ironpython-released-on-12-and-updated.html" title="IronPython released on 12 and updated on 13 march." /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><thr:total>0</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/03/ironpython-released-on-12-and-updated.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkQFSXY5cSp7ImA9Wx9aGU8.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-5150276019434301166</id><published>2011-03-12T03:09:00.000-08:00</published><updated>2011-03-12T03:11:58.829-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-12T03:11:58.829-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="PyCon 2011" /><category scheme="http://www.blogger.com/atom/ns#" term="tutorials" /><title>Tutorials from PyCon 2011</title><content type="html">PyCon 2011 is held from March 9th through the 17th, 2011 in Atlanta, Georgia.&lt;br /&gt;
It is the annual Python community conference.&lt;br /&gt;
More on this page:&lt;a href="http://us.pycon.org/2011/schedule/tutorials/"&gt;Pycon 2011 tutorials&lt;/a&gt;&lt;br /&gt;
&lt;iframe src="http://rcm.amazon.com/e/cm?t=pythoncatalin-20&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=B0001HAGTM&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;"align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=pythoncatalin-20&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=1933784725&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;"align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-5150276019434301166?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3_ZnotsTJBYGFNL8wFKS9iXr5h8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3_ZnotsTJBYGFNL8wFKS9iXr5h8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3_ZnotsTJBYGFNL8wFKS9iXr5h8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3_ZnotsTJBYGFNL8wFKS9iXr5h8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/BY5X7OAe20U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/5150276019434301166/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/03/tutorials-from-pycon-2011.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/5150276019434301166?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/5150276019434301166?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/BY5X7OAe20U/tutorials-from-pycon-2011.html" title="Tutorials from PyCon 2011" /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><thr:total>2</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/03/tutorials-from-pycon-2011.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkAGRn05eyp7ImA9Wx9bFEk.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-1647845691149747212</id><published>2011-02-23T00:12:00.001-08:00</published><updated>2011-02-23T00:12:07.323-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-23T00:12:07.323-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="urllib" /><category scheme="http://www.blogger.com/atom/ns#" term="minidom" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="weather" /><category scheme="http://www.blogger.com/atom/ns#" term="conky" /><title>Just a simple python weather script.</title><content type="html">Sometimes we need simple solutions. An example is displaying data on a computer screen using conky. under Linux.&lt;br /&gt;
Another example is the display of data without using the browser.&lt;br /&gt;
Whether you use Windows or Linux python scripts come to help. Here's a simple example written in python that can display weather data.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;import urllib
from xml.dom import minidom

wurl = 'http://xml.weather.yahoo.com/forecastrss?p=%s'
wser = 'http://xml.weather.yahoo.com/ns/rss/1.0'

def weather_for_zip(zip_code):
    url = wurl % zip_code +'&amp;u=c'
    dom = minidom.parse(urllib.urlopen(url))
    forecasts = []
    for node in dom.getElementsByTagNameNS(wser, 'forecast'):
        forecasts.append({
            'date': node.getAttribute('date'),
            'low': node.getAttribute('low'),
            'high': node.getAttribute('high'),
            'condition': node.getAttribute('text')
        })
    ycondition = dom.getElementsByTagNameNS(wser, 'condition')[0]
    return {
        'current_condition': ycondition.getAttribute('text'),
        'current_temp': ycondition.getAttribute('temp'),
        'forecasts': forecasts ,
        'title': dom.getElementsByTagName('title')[0].firstChild.data
    }
def main():
    a=weather_for_zip("ROXX0003")
    print '=================================='
    print '|',a['title'],'|'
    print '=================================='
    print '|current condition=',a['current_condition']
    print '|current temp     =',a['current_temp']
    print '=================================='
    print '|  today     =',a['forecasts'][0]['date']
    print '|  hight     =',a['forecasts'][0]['high']
    print '|  low       =',a['forecasts'][0]['low']
    print '|  condition =',a['forecasts'][0]['condition']
    print '=================================='
    print '|  tomorrow  =',a['forecasts'][1]['date']
    print '|  hight     =',a['forecasts'][1]['high']
    print '|  low       =',a['forecasts'][1]['low']
    print '|  condition =',a['forecasts'][1]['condition']
    print '=================================='

main()
&lt;/code&gt;&lt;/pre&gt;Here is the result of script execution:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
&gt;&gt;&gt; 
==================================
| Yahoo! Weather - Bucharest, RO |
==================================
|current condition= Light Snow
|current temp     = -3
==================================
|  today     = 23 Feb 2011
|  hight     = 0
|  low       = -5
|  condition = Light Snow
==================================
|  tomorrow  = 24 Feb 2011
|  hight     = 0
|  low       = -4
|  condition = Mostly Cloudy
==================================
&gt;&gt;&gt; 
&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-1647845691149747212?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/S31q7zT9ti_yPJqVhqx-N-OGLLs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/S31q7zT9ti_yPJqVhqx-N-OGLLs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/S31q7zT9ti_yPJqVhqx-N-OGLLs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/S31q7zT9ti_yPJqVhqx-N-OGLLs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/p6udaSrfFcs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/1647845691149747212/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/02/just-simple-python-weather-script.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/1647845691149747212?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/1647845691149747212?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/p6udaSrfFcs/just-simple-python-weather-script.html" title="Just a simple python weather script." /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><thr:total>0</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/02/just-simple-python-weather-script.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEYEQH89fyp7ImA9Wx9VF0g.&quot;"><id>tag:blogger.com,1999:blog-2577456377723588929.post-7603221582907886024</id><published>2011-02-03T10:01:00.000-08:00</published><updated>2011-02-03T10:01:41.167-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-03T10:01:41.167-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="bnr" /><category scheme="http://www.blogger.com/atom/ns#" term="feed" /><title>Read feed from sites.</title><content type="html">Is a simple example for reading some feed.&lt;br /&gt;
I use two functions , first read url and secondary extract data.&lt;br /&gt;
This is the code source:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
from xml.dom import minidom as dom
import urllib

def fetchPage(url):
    a = urllib.urlopen(url)
    return ''.join(a.readlines())


def extract(page):
    a = dom.parseString(page)
    item2 = a.getElementsByTagName('SendingDate')[0].firstChild.wholeText
    print "DATA ",item2
    item = a.getElementsByTagName('Cube')
    for i in item:
        if i.hasChildNodes() == True:
            e = i.getElementsByTagName('Rate')[10].firstChild.wholeText
            d = i.getElementsByTagName('Rate')[26].firstChild.wholeText
            print "EURO  ",e
            print "DOLAR ",d

if __name__=='__main__':
    page = fetchPage("http://www.bnro.ro/nbrfxrates.xml")

    extract(page)
&lt;/code&gt;&lt;/pre&gt;Result is :&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
DATA  2011-02-03
EURO   4.2609
DOLAR  3.0921
&lt;/code&gt;&lt;/pre&gt;This is all...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2577456377723588929-7603221582907886024?l=python-catalin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/jqesBZAStW8x809mBw6wRKi5Qqw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jqesBZAStW8x809mBw6wRKi5Qqw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/jqesBZAStW8x809mBw6wRKi5Qqw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jqesBZAStW8x809mBw6wRKi5Qqw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Python-catalin/~4/dX3OJSdn63E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://python-catalin.blogspot.com/feeds/7603221582907886024/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://python-catalin.blogspot.com/2011/02/read-feed-from-sites.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/7603221582907886024?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2577456377723588929/posts/default/7603221582907886024?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Python-catalin/~3/dX3OJSdn63E/read-feed-from-sites.html" title="Read feed from sites." /><author><name>Catalin Festila</name><uri>http://www.blogger.com/profile/10800322932529698711</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://2.bp.blogspot.com/_bKSzsk0V0BA/S0M6nv_iqgI/AAAAAAAADGE/E_vmGFgXuSU/S220/cata.jpeg" /></author><thr:total>1</thr:total><feedburner:origLink>http://python-catalin.blogspot.com/2011/02/read-feed-from-sites.html</feedburner:origLink></entry></feed>

