<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="http://www.pythonblogs.com/styles/rss.css" type="text/css"?>
<rss version="2.0">
 <channel>
  <title>Python Blogs</title>
  <description>Python Community Blogs</description>
  <link>http://www.pythonblogs.com/summary.php</link>
  <generator>LifeType 1.0</generator>
          
  <item>
   <title>Reportlab and Pisa</title>
   <description>&lt;p&gt;
Reportlab and Pisa&lt;br /&gt;
&lt;br /&gt;
PDF display or download through a web page is always an excellent idea to impress other if it&#039;s done on the fly, and Reportlab and Pisa gives you the great feature to do that.&lt;br /&gt;
In my case, i had a small file and using that file i have to create PDF, obviously with too many calculations and plots(Reportlab used). So, if you are using python then none other tool is as good as reportlab and Pisa.&lt;br /&gt;
I feel very comfortable to create HTML first and then convert it to PDF using Pisa. Here is the simple solution or you can say kind of HTML template to convert to PDF.&lt;br /&gt;
To understand this code, you need to go through Pisa documentation.&lt;br /&gt;
&lt;br /&gt;
[code python]
&lt;/p&gt;
&lt;p&gt;
import cStringIO&lt;br /&gt;
import ho.pisa as pisa&lt;br /&gt;
&lt;br /&gt;
def convert(data, filename, open=False):&lt;br /&gt;
    pdfFile = file(filename, &quot;wb&quot;)&lt;br /&gt;
    pdf = pisa.CreatePDF(&lt;br /&gt;
       cStringIO.StringIO(data.encode(&quot;ISO-8859-1&quot;)),pdfFile)&lt;br /&gt;
    pdfFile.close()&lt;br /&gt;
    if not pdf.err:&lt;br /&gt;
        pisa.startViewer(filename)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__==&quot;__main__&quot;:&lt;br /&gt;
    HTML = &quot;&quot;&quot;&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;&lt;br /&gt;
    &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&amp;gt;&lt;br /&gt;
    &amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=iso-8859-1&quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;style type=&quot;text/css&quot; media=&quot;all&quot;&amp;gt;&lt;br /&gt;
            @page {&lt;br /&gt;
            margin: 0.5cm;&lt;br /&gt;
            margin-top:1.8cm;&lt;br /&gt;
            margin-bottom: 1cm;&lt;br /&gt;
            @frame footer {&lt;br /&gt;
            -pdf-frame-content: footerContent;&lt;br /&gt;
            bottom: 0.5cm;&lt;br /&gt;
            margin-left: 0.75cm;&lt;br /&gt;
            margin-right: 0.75cm;&lt;br /&gt;
            height: 1cm;&lt;br /&gt;
            }&lt;br /&gt;
            @frame header {&lt;br /&gt;
            -pdf-frame-content: headerContent;&lt;br /&gt;
            top: 0.2cm;&lt;br /&gt;
            margin-left: 0.75cm;&lt;br /&gt;
            margin-right: 0.75cm;&lt;br /&gt;
            height: 2cm;&lt;br /&gt;
            }&lt;br /&gt;
            }&lt;br /&gt;
            .footer .head&lt;br /&gt;
            {&lt;br /&gt;
                position:absolute;&lt;br /&gt;
                left:0;&lt;br /&gt;
                top:4;&lt;br /&gt;
                width:100%;&lt;br /&gt;
            }&lt;br /&gt;
            table {&lt;br /&gt;
            -pdf-keep-in-frame-mode: shrink;&lt;br /&gt;
            }&lt;br /&gt;
            h1 {&lt;br /&gt;
                page-break-before:always;&lt;br /&gt;
            }&lt;br /&gt;
        &amp;lt;/style&amp;gt;&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
    &amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&quot;headerContent&quot; class=&quot;head&quot;&amp;gt;&lt;br /&gt;
        &amp;lt;table width=&quot;100%&quot; height=&quot;100px&quot; border=&quot;0&quot; &amp;gt;&lt;br /&gt;
            &amp;lt;tr&amp;gt;&lt;br /&gt;
            &amp;lt;td wodth=&quot;25%&quot;&amp;gt;&amp;lt;img src=&quot;logo.gif&quot; width=&quot;70px&quot; height=&quot;80px&quot;/&amp;gt;Company Name&amp;lt;/td&amp;gt;&lt;br /&gt;
            &amp;lt;td align=&quot;center&quot; width=&quot;50%&quot;&amp;gt;&amp;lt;font face=&quot;Helvetica-Bold&quot; size=&quot;24&quot;&amp;gt; Title &amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
            &amp;lt;td width=&quot;25%&quot;&amp;gt;&amp;lt;font face=&quot;Helvetica&quot; size=&quot;4&quot;&amp;gt;Sub titles&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
            &amp;lt;/tr&amp;gt;&lt;br /&gt;
        &amp;lt;/table&amp;gt;&lt;br /&gt;
        &amp;lt;/div&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/br&amp;gt;&lt;br /&gt;
            &amp;lt;h1&amp;gt;YOUR OTHER HTML CONTENT WILL GO HERE..........&amp;lt;/h1&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/br&amp;gt;&lt;br /&gt;
            &amp;lt;h1&amp;gt;YOUR OTHER HTML CONTENT WILL GO HERE..........&amp;lt;/h1&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/br&amp;gt;&lt;br /&gt;
            &amp;lt;h1&amp;gt;YOUR OTHER HTML CONTENT WILL GO HERE..........&amp;lt;/h1&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/br&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&quot;footerContent&quot;&amp;gt;&lt;br /&gt;
              &amp;lt;div class=&quot;footer&quot;&amp;gt;&lt;br /&gt;
            This is footer.. Page &amp;lt;pdf:pagenumber/&amp;gt; &lt;br /&gt;
              &amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
    &amp;lt;/html&amp;gt;&quot;&quot;&quot;&lt;br /&gt;
    convert(HTML, &#039;pisa_example.pdf&#039;)&lt;br /&gt;
[/code]
&lt;/p&gt;
&lt;p&gt;
Say thanks to me if this code helps you :)  
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;</description>
   <link>http://pymantra.pythonblogs.com/90_pymantra/archive/1289_reportlab_and_pisa.html</link>
   <comments>http://pymantra.pythonblogs.com/90_pymantra/archive/1289_reportlab_and_pisa.html</comments>
   <guid>http://pymantra.pythonblogs.com/90_pymantra/archive/1289_reportlab_and_pisa.html</guid>
      <author>sharmavivek82</author>
   <category>
           python 
        </category>
   <source url="http://pymantra.pythonblogs.com/90_pymantra/feeds/rss20">PyMantra</source>
  </item>
          
  <item>
   <title>SimpleAI, Artificial Intelligence with python</title>
   <description>&lt;strong id=&quot;internal-source-marker_0.25998517870903015&quot; style=&quot;font-family: &#039;Times New Roman&#039;; font-size: medium; font-weight: normal&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; background-color: #ffffcc; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;SimpleAI&lt;/span&gt;&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt; is an easy to use lib implementing in python many of the&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;artificial intelligence algorithms described on the book &quot;Artificial&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;Ingelligence, a Modern Approach&quot;, from Stuart Russel and Peter Norvig.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;This implementation takes some of the ideas from the Norvig&#039;s&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;implementation (the aima-python lib), but it&#039;s made with a more&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;&quot;pythonic&quot; approach, and more emphasis on creating a stable, modern,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;and mantenible version. We are testing the majority of the lib, it&#039;s&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;available via pip install, has a standard repository and lib architecture,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;well documented, respects the python pep8 guidelines, provides only&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;working code (no placeholders for future things), etc. Even the&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;internal code is written with readability in mind, not only the&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;external API.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;This new release adds a few statistical classification methods to &lt;/span&gt;&lt;span style=&quot;font-size: 16px; background-color: #ffffcc; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;SIMPLEAI&lt;/span&gt;&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt; with&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;the intention of start replicating the machine learning aspects of aima-python.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;There is a special focus in decision tree learning, where three different&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;methods for decision tree learning are added, with one of them following&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;strictly the aima pseudo-code, being particularly useful for teaching.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;The other classifiers added are Naive Bayes and K-Nearest Neighbors.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;This release also includes lots of tests for the classifiers, documentation,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;and a few sample uses of the classifiers&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://pypi.python.org/pypi/simpleai/&quot;&gt;&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #1155cc&quot;&gt;http://pypi.python.org/pypi/simpleai/&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://github.com/simpleai-team/simpleai&quot;&gt;&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #1155cc&quot;&gt;https://github.com/simpleai-team/simpleai&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-size: 16px; vertical-align: baseline; white-space: pre-wrap; font-family: Arial; color: #222222&quot;&gt;.&lt;/span&gt;&lt;/strong&gt;</description>
   <link>http://machinalis.pythonblogs.com/216_machinalis/archive/1281_simpleai_artificial_intelligence_with_python.html</link>
   <comments>http://machinalis.pythonblogs.com/216_machinalis/archive/1281_simpleai_artificial_intelligence_with_python.html</comments>
   <guid>http://machinalis.pythonblogs.com/216_machinalis/archive/1281_simpleai_artificial_intelligence_with_python.html</guid>
      <author>machinalis</author>
   <category>
           python 
           ai 
           simpleai 
           aima 
        </category>
   <source url="http://machinalis.pythonblogs.com/216_machinalis/feeds/rss20">Machinalis</source>
  </item>
          
  <item>
   <title>Algoritmo en python 3 para realizar la búsqueda A* (A estrella)</title>
   <description>&lt;p&gt;
[code python]
&lt;/p&gt;
&lt;p&gt;
#!/usr/bin/python -w
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
# Inicializamos las listas de abiertos y cerradas en vacio
&lt;/p&gt;
&lt;p&gt;
# Inicializamos todos los estados como arreglos de clave y valor,
&lt;/p&gt;
&lt;p&gt;
# con sus respectivos estados vecinos como clave y el costo como valor
&lt;/p&gt;
&lt;p&gt;
# Establecemos la lista de estados, para luego accederla mediante el indice
&lt;/p&gt;
&lt;p&gt;
# y tambien la lista de distancias entre cada par de estados.
&lt;/p&gt;
&lt;p&gt;
opened = []
&lt;/p&gt;
&lt;p&gt;
closed = []
&lt;/p&gt;
&lt;p&gt;
q0 = {1:5, 2:4, 3:11}
&lt;/p&gt;
&lt;p&gt;
q1 = {0:5, 3:6, 4:15}
&lt;/p&gt;
&lt;p&gt;
q2 = {0:4, 3:5, 4:12}
&lt;/p&gt;
&lt;p&gt;
q3 = {0:11, 1:6, 2:5, 4:5}
&lt;/p&gt;
&lt;p&gt;
q4 = {1:15, 2:12, 3:5}
&lt;/p&gt;
&lt;p&gt;
states = [q0, q1, q2, q3, q4]
&lt;/p&gt;
&lt;p&gt;
distances = [[0, 5, 4, 11, 17], [5, 0, 5, 6, 15], [4, 5, 0, 5, 12], [11, 6, 5, 0, 5], [17, 15, 12, 5, 0]]
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
# Funcion para obtener el camino entre 2 estados, mediante el algoritmo de busqueda A*
&lt;/p&gt;
&lt;p&gt;
def get_way(start, goal):
&lt;/p&gt;
&lt;p&gt;
    actual = start
&lt;/p&gt;
&lt;p&gt;
    # &quot;Importamos&quot; nuestra variable global para poderla modificar localmente
&lt;/p&gt;
&lt;p&gt;
    global opened
&lt;/p&gt;
&lt;p&gt;
    # Agregamos el estado actual a la lista de estados abiertos
&lt;/p&gt;
&lt;p&gt;
    opened.append(actual)
&lt;/p&gt;
&lt;p&gt;
    finalized = False
&lt;/p&gt;
&lt;p&gt;
    # No terminaremos hasta que no hayamos llegado a el estado meta
&lt;/p&gt;
&lt;p&gt;
    while not finalized:
&lt;/p&gt;
&lt;p&gt;
        # Si el estado actual es igual a la meta, entonces agregamos al estado acual
&lt;/p&gt;
&lt;p&gt;
        # a la lista de cerrados y devolvemos la lista la cual indica nuestro camino
&lt;/p&gt;
&lt;p&gt;
        if actual == goal:
&lt;/p&gt;
&lt;p&gt;
            closed.append(actual)
&lt;/p&gt;
&lt;p&gt;
            return closed
&lt;/p&gt;
&lt;p&gt;
        else:
&lt;/p&gt;
&lt;p&gt;
            # Si no, tomamos todos los estados vecinos del estado actual que no se incluyen
&lt;/p&gt;
&lt;p&gt;
            # en la lista de estados cerrados, y los agregamos a la lista de abiertos
&lt;/p&gt;
&lt;p&gt;
            opened = [k for k in states[actual].keys() if k not in closed]
&lt;/p&gt;
&lt;p&gt;
            # Cerramos el estado actual
&lt;/p&gt;
&lt;p&gt;
            closed.append(actual)
&lt;/p&gt;
&lt;p&gt;
            # Ahora tomamos como estado actual, aquel estado vecino con el menor costo
&lt;/p&gt;
&lt;p&gt;
            # y distancia
&lt;/p&gt;
&lt;p&gt;
            actual = less_f_score(actual, opened)
&lt;/p&gt;
&lt;p&gt;
            # Limpiamos la lista de abiertos y realizamos una iteracion mas
&lt;/p&gt;
&lt;p&gt;
            opened = []
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
# Funcion para determinar el estado vecino con el menor costo y distancia
&lt;/p&gt;
&lt;p&gt;
def less_f_score(actual, opened):
&lt;/p&gt;
&lt;p&gt;
    # Obtenemos la suma del costo y la distancia menor, para un conjunto de estados vecinos
&lt;/p&gt;
&lt;p&gt;
    less = min([states[actual][state] + distances[state][goal] for state in opened])
&lt;/p&gt;
&lt;p&gt;
    # Recorremos la lista de vecinos
&lt;/p&gt;
&lt;p&gt;
    for state in opened:
&lt;/p&gt;
&lt;p&gt;
        # Si la suma del costo y la distancia para un estado es igual a la menor
&lt;/p&gt;
&lt;p&gt;
        # entonces devolvemos dicho estado
&lt;/p&gt;
&lt;p&gt;
        if states[actual][state] + distances[state][goal] == less:
&lt;/p&gt;
&lt;p&gt;
            return state
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
if __name__ == &quot;__main__&quot;:
&lt;/p&gt;
&lt;p&gt;
    # Ingresamos los valores para el estado inicial y el estado meta
&lt;/p&gt;
&lt;p&gt;
    start = input(&quot;Input the start state: &quot;)
&lt;/p&gt;
&lt;p&gt;
    goal = input(&quot;Input the goal state: &quot;)
&lt;/p&gt;
&lt;p&gt;
    try:
&lt;/p&gt;
&lt;p&gt;
        # Los convertimos a enteros
&lt;/p&gt;
&lt;p&gt;
        start = int(start)
&lt;/p&gt;
&lt;p&gt;
        goal = int(goal)
&lt;/p&gt;
&lt;p&gt;
    except:
&lt;/p&gt;
&lt;p&gt;
    print(&quot;Invalid number&quot;)
&lt;/p&gt;
&lt;p&gt;
    # Obtenemos el camino el cual es una lista de estados
&lt;/p&gt;
&lt;p&gt;
    way = get_way(start, goal)
&lt;/p&gt;
&lt;p&gt;
    # Imprimimos la respuesta
&lt;/p&gt;
&lt;p&gt;
    print(&quot;&amp;lt;&quot;, end = &quot; &quot;) 
&lt;/p&gt;
&lt;p&gt;
    for state in way:
&lt;/p&gt;
&lt;p&gt;
        print(state, end = &quot; &quot;)
&lt;/p&gt;
&lt;p&gt;
    print(&quot;&amp;gt;&quot;)
&lt;/p&gt;
&lt;p&gt;
    # Terminamos
&lt;/p&gt;
&lt;p&gt;
[/code] 
&lt;/p&gt;</description>
   <link>http://bytesofcode.pythonblogs.com/102_bytesofcode/archive/1277_algoritmo_en_python_3_para_realizar_la_bsqueda_a_a_estrella.html</link>
   <comments>http://bytesofcode.pythonblogs.com/102_bytesofcode/archive/1277_algoritmo_en_python_3_para_realizar_la_bsqueda_a_a_estrella.html</comments>
   <guid>http://bytesofcode.pythonblogs.com/102_bytesofcode/archive/1277_algoritmo_en_python_3_para_realizar_la_bsqueda_a_a_estrella.html</guid>
      <author>pythonista</author>
   <category>
           python 3 
        </category>
   <source url="http://bytesofcode.pythonblogs.com/102_bytesofcode/feeds/rss20">bytesofcode</source>
  </item>
          
  <item>
   <title>A Heroku Python Flask website application</title>
   <description>&lt;p&gt;
We have been talking about Heroku applications using Python, where we can set up Python based web hosting without the need to work around Apache to get a python based web site running. In our python website example we use the flask library instead of Apache for the server.
&lt;/p&gt;
&lt;p&gt;
The simplest &#039;Hello World&#039; flask application is easy to find. It is on the Heroku website as well as in documentation that can be found for the Flask modules. Nonetheless, here it is again:
&lt;/p&gt;
&lt;p&gt;
[code python]
from flask import Flask&lt;br /&gt;
&lt;br /&gt;
app = Flask(__name__)&lt;br /&gt;
@app.route(&#039;/&#039;)&lt;br /&gt;
def hello():&lt;br /&gt;
 return &#039;Hello World!&#039;
if __name__ == &#039;__main__&#039;:
 app.run(&#039;&#039;)
[/code]
&lt;/p&gt;
&lt;p&gt;
To simplify using flask, lets just run this application on our Ubuntu computer to 127.0.0.1
&lt;/p&gt;
&lt;p&gt;
To do this, we need to have the Flask library available to applications.
&lt;/p&gt;
&lt;p&gt;
    pip install flask
&lt;/p&gt;
&lt;p&gt;
Then, all we need to do to see our &#039;Hello World&#039; application is this:
&lt;/p&gt;
&lt;p&gt;
    python hello.py
&lt;/p&gt;
&lt;p&gt;
Holy strawberries Batman! We&#039;ve got a website! Does Heroku work this simply? No, the Heroku version of Hello World contains two extra lines of code, and uses the OS module for Python, so to conclude today&#039;s discussion about simple python web site applications, here is the Heroku version of Hello World.
&lt;/p&gt;
&lt;p&gt;
[code python]
import os
from flask import Flask
app = Flask(__name__)
@app.route(&#039;/&#039;)
def hello():
 return &#039;Hello World!&#039;
if __name__ == &#039;__main__&#039;:
# Bind to PORT if defined, otherwise default to 5000.
 port = int(os.environ.get(&#039;PORT&#039;, 5000))
 app.run(host=&#039;0.0.0.0&#039;, port=port)[/code]
&lt;/p&gt;
&lt;p&gt;
If you don&#039;t believe me, go to the www.heroku.com website, they really deserve the credit, because I cut and pasted this example from them. Two lines of code are added to the main execution body of the example, first the variable &#039;port&#039; is set with the results of an operating system call and that is provided for the app.run command.
&lt;/p&gt;
&lt;p&gt;
Can you think of a way to turn this into a single line of code? If you can, you have started to read and understand Python, and hopefully look forward to our next discussion on Python Flask Heroku applications. See you later, alligator! 
&lt;/p&gt;</description>
   <link>http://python-projects.pythonblogs.com/213_python_projects/archive/1276_a_heroku_python_flask_website_application.html</link>
   <comments>http://python-projects.pythonblogs.com/213_python_projects/archive/1276_a_heroku_python_flask_website_application.html</comments>
   <guid>http://python-projects.pythonblogs.com/213_python_projects/archive/1276_a_heroku_python_flask_website_application.html</guid>
      <author>sookies</author>
   <category>
           General 
        </category>
   <source url="http://python-projects.pythonblogs.com/213_python_projects/feeds/rss20">Python Projects</source>
  </item>
          
  <item>
   <title>&quot;Hello World!&quot; - the pyton version</title>
   <description>&lt;div style=&quot;font-size: medium&quot;&gt;
&lt;p&gt;
The python way is to do more, by doing less. So the very first python program of every chap should be:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;
#!/usr/bin/env python
import this
&lt;/pre&gt;
&lt;p&gt;
It&#039;s a statement, a goal and the dawn of enlightment - in short: pure beauty.
&lt;/p&gt;
&lt;/div&gt;</description>
   <link>http://see-one-do-one-teach-one.pythonblogs.com/215_see_one-do_one-teach_one/archive/1270_hello_world-the_pyton_version.html</link>
   <comments>http://see-one-do-one-teach-one.pythonblogs.com/215_see_one-do_one-teach_one/archive/1270_hello_world-the_pyton_version.html</comments>
   <guid>http://see-one-do-one-teach-one.pythonblogs.com/215_see_one-do_one-teach_one/archive/1270_hello_world-the_pyton_version.html</guid>
      <author>max</author>
   <category>
           General 
           Bloglol 
        </category>
   <source url="http://see-one-do-one-teach-one.pythonblogs.com/215_see_one-do_one-teach_one/feeds/rss20">See one - Do one - Teach one!</source>
  </item>
          
  <item>
   <title>Python Coding Standards</title>
   <description>&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
Coding standards is not only to avoid ugly code. It is very useful to get responses quickly.
&lt;/p&gt;
&lt;p&gt;
You can see the python coding standards in &lt;a href=&quot;http://www.python.org/dev/peps/pep-0008/&quot; title=&quot;PEP8&quot;&gt;PEP8&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;
There are many third party packages to test standards you used in your modules. Especially pylint package is very simple to use. 
&lt;/p&gt;
&lt;p&gt;
To install pylint follow the link &lt;a href=&quot;http://pypi.python.org/pypi/pylint&quot; title=&quot;Pylint&quot;&gt;http://pypi.python.org/pypi/pylint&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Examples:
&lt;/p&gt;
&lt;p&gt;
Here I write two modules having same logic. First one(ws.py) is written with standards and another one(wos.py) is not having standards. 
&lt;/p&gt;
&lt;p&gt;
#### With Standards (ws.py) ####
&lt;/p&gt;
&lt;p&gt;
&quot;&quot;&quot;&lt;br /&gt;
Test the coding standards&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;
&quot;&quot;&quot; 
&lt;/p&gt;
&lt;p&gt;
from datetime import datetime, timedelta&lt;br /&gt;
 &lt;br /&gt;
def with_standard():&lt;br /&gt;
    &quot;&quot;&quot;
&lt;/p&gt;
&lt;p&gt;
    Test the coding standards&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;
    &quot;&quot;&quot;
&lt;/p&gt;
&lt;p&gt;
    st_time = datetime.\&lt;br /&gt;
                now()&lt;br /&gt;
    data = {&#039;los&#039;:30,&lt;br /&gt;
            &#039;san&#039;:60,&lt;br /&gt;
            &#039;can&#039;:80,&lt;br /&gt;
            &#039;New&#039;:20}&lt;br /&gt;
    for city, provider_count in data.\&lt;br /&gt;
                                iteritems():&lt;br /&gt;
        if (city != &#039;&#039; and \&lt;br /&gt;
            provider_count &amp;lt; 100):&lt;br /&gt;
            pass&lt;br /&gt;
    end_time = (datetime.\&lt;br /&gt;
                now() - timedelta(hours=st_time.hour,&lt;br /&gt;
                                  seconds=st_time.second,&lt;br /&gt;
                                  microseconds=st_time.microsecond))&lt;br /&gt;
    print &quot;To get response the script took %s \&lt;br /&gt;
(Hour:Minutes:Seconds MicroSeconds)&quot; % (end_time.\&lt;br /&gt;
                                            strftime(&#039;%H:%M:%S %f&#039;))&lt;br /&gt;
    return ()&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    with_standard()
&lt;/p&gt;
&lt;p&gt;
### End of Module ### 
&lt;/p&gt;
&lt;p&gt;
### Without standards (wos.py) ###
&lt;/p&gt;
&lt;p&gt;
from datetime import datetime,timedelta&lt;br /&gt;
 &lt;br /&gt;
def without_standard():&lt;br /&gt;
    st_time = datetime.now()&lt;br /&gt;
    data = {&#039;los&#039;:30,&#039;san&#039;:60,&#039;can&#039;:80,&#039;New&#039;:20}&lt;br /&gt;
    for key,value in data.iteritems():&lt;br /&gt;
        if key != &#039;&#039; and value &amp;lt; 100:&lt;br /&gt;
            pass&lt;br /&gt;
    end_time = datetime.now() - timedelta(hours=st_time.hour,seconds=st_time.second,microseconds=st_time.microsecond)&lt;br /&gt;
    print &quot;To get response the script took %s (Hour:Minutes:Seconds MicroSeconds)&quot; %(end_time.strftime(&#039;%H:%M:%S %f&#039;)) &lt;br /&gt;
    return ()&lt;br /&gt;
    &lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    without_standard()
&lt;/p&gt;
&lt;p&gt;
### End of Module ### 
&lt;/p&gt;
&lt;p&gt;
Test standards:
&lt;/p&gt;
&lt;p&gt;
If we execute &lt;strong&gt;pylint ws.py&lt;/strong&gt; command from command line, it will give 10.00/10 as the standards rate.
&lt;/p&gt;
&lt;p&gt;
When we execute &lt;strong&gt;pylint wos.py&lt;/strong&gt; command, it will give 3.85/10 as the rate. 
&lt;/p&gt;
&lt;p&gt;
Now you can see a huge difference between standards&#039; rate. 
&lt;/p&gt;
&lt;p&gt;
So try to follow standards in your future modules :) 
&lt;/p&gt;</description>
   <link>http://my-blog.pythonblogs.com/214_my_blog/archive/1267_python_coding_standards.html</link>
   <comments>http://my-blog.pythonblogs.com/214_my_blog/archive/1267_python_coding_standards.html</comments>
   <guid>http://my-blog.pythonblogs.com/214_my_blog/archive/1267_python_coding_standards.html</guid>
      <author>ugkarthik</author>
   <category>
           Python 
        </category>
   <source url="http://my-blog.pythonblogs.com/214_my_blog/feeds/rss20">My Blog</source>
  </item>
          
  <item>
   <title>IDLE Easter Egg...</title>
   <description>&lt;p&gt;
Presented without comment, aside from the fact that this made me laugh on an otherwise frustrating day...  
&lt;/p&gt;
&lt;p&gt;
[code python] 
&lt;/p&gt;
&lt;p&gt;
import antigravity 
&lt;/p&gt;
&lt;p&gt;
[/code] 
&lt;/p&gt;
&lt;p&gt;
Update: I found an &lt;a href=&quot;http://python-history.blogspot.com/2010/06/import-antigravity.html&quot; title=&quot;import antigravity history&quot;&gt;article&lt;/a&gt; talking about this, with a comment from the BDFL... 
&lt;/p&gt;</description>
   <link>http://python-for-analysts.pythonblogs.com/211_python-for-analysts/archive/1263_idle_easter_egg.html</link>
   <comments>http://python-for-analysts.pythonblogs.com/211_python-for-analysts/archive/1263_idle_easter_egg.html</comments>
   <guid>http://python-for-analysts.pythonblogs.com/211_python-for-analysts/archive/1263_idle_easter_egg.html</guid>
      <author>numbercruncher</author>
   <category>
           Python 
        </category>
   <source url="http://python-for-analysts.pythonblogs.com/211_python-for-analysts/feeds/rss20">python-for-analysts</source>
  </item>
          
  <item>
   <title>Workaround for Python bug: &#039;ascii&#039; codec can&#039;t encode character u&#039;\xa0&#039; in position 111: ordinal not in range(128)</title>
   <description>&lt;p&gt;
Have you ever needed to read unicode data file from Python?
&lt;/p&gt;
&lt;p&gt;
If so, you know that it is harder than it sounds. 
&lt;/p&gt;
&lt;p&gt;
Even if you set your environment (e.g. export LANG=fr_FR.UTF8) to use utf-8 Python as of 2.7.1 still might not pick up this and will try to read file in ascii resulting in all too common: &lt;em&gt;&#039;ascii&#039; codec can&#039;t encode character u&#039;\xa0&#039; in position 111: ordinal not in range(128) &lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
After lots of trial and error I found a workaround that works. First of all check if you have this problem by executing:
&lt;/p&gt;
&lt;p&gt;
[code python] &lt;br /&gt;
import sys&lt;br /&gt;
sys.getdefaultencoding()&lt;br /&gt;
[/code]
&lt;/p&gt;
&lt;p&gt;
if it comes back with &#039;ascii&#039; then read on. 
&lt;/p&gt;
&lt;p&gt;
Default encoding need to be changed. However this is only possible when sys module is reloaded. 
&lt;/p&gt;
&lt;p&gt;
Here is a complete solution:
&lt;/p&gt;
&lt;p&gt;
[code python]&lt;br /&gt;
import sys;&lt;br /&gt;
reload(sys);&lt;br /&gt;
sys.setdefaultencoding(&quot;utf8&quot;)&lt;br /&gt;
[/code] 
&lt;/p&gt;</description>
   <link>http://mypy.pythonblogs.com/12_mypy/archive/1253_workaround_for_python_bug_ascii_codec_cant_encode_character_uxa0_in_position_111_ordinal_not_in_range128.html</link>
   <comments>http://mypy.pythonblogs.com/12_mypy/archive/1253_workaround_for_python_bug_ascii_codec_cant_encode_character_uxa0_in_position_111_ordinal_not_in_range128.html</comments>
   <guid>http://mypy.pythonblogs.com/12_mypy/archive/1253_workaround_for_python_bug_ascii_codec_cant_encode_character_uxa0_in_position_111_ordinal_not_in_range128.html</guid>
      <author>mypy</author>
   <category>
           General 
        </category>
   <source url="http://mypy.pythonblogs.com/12_mypy/feeds/rss20">mypy</source>
  </item>
          
  <item>
   <title>Python-Basics</title>
   <description>&lt;h1 class=&quot;firstHeading&quot; id=&quot;firstHeading&quot; style=&quot;color: #000000; background-image: none; font-weight: normal; margin: 0px 0px 0.1em; overflow: hidden; padding-top: 0px; padding-bottom: 0px; border-bottom: 1px solid #aaaaaa; font-size: 1.6em; line-height: 1.2em; font-family: sans-serif; font-style: normal; font-variant: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px&quot;&gt;&lt;br /&gt;
&lt;/h1&gt;
&lt;p&gt;
&lt;u&gt;&lt;span style=&quot;font-size: small&quot;&gt;&lt;em&gt;&lt;strong&gt;List of Python Software :&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt; &lt;/u&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href=&quot;http://en.wikipedia.org/wiki/List_of_Python_software&quot;&gt;http://en.wikipedia.org/wiki/List_of_Python_software&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;ul id=&quot;pagelocation&quot; style=&quot;margin: 0px; padding: 0px; color: #000000; font-family: Arial,Verdana,Geneva,&#039;Bitstream Vera Sans&#039;,Helvetica,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: #f7f7f7&quot;&gt;
	&lt;li style=&quot;list-style-type: none; margin: 0px 1em 0px 0px; padding: 0px; display: inline; font-size: 16px&quot;&gt;&lt;a class=&quot;backlink&quot; href=&quot;http://wiki.python.org/moin/OrganizationsUsingPython?action=fullsearch&amp;amp;context=180&amp;amp;value=linkto%3A%22OrganizationsUsingPython%22&quot; title=&quot;Click to do a full-text search for this title&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-size: small&quot;&gt;&lt;em&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;strong&gt;Organizations Using Python :&lt;/strong&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
	&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
 &lt;a href=&quot;http://wiki.python.org/moin/OrganizationsUsingPython&quot;&gt;http://wiki.python.org/moin/OrganizationsUsingPython&lt;/a&gt;
&lt;/p&gt;</description>
   <link>http://muthuvel-pythonblog.pythonblogs.com/207_muthuvel-pythonblog/archive/1251_python-basics.html</link>
   <comments>http://muthuvel-pythonblog.pythonblogs.com/207_muthuvel-pythonblog/archive/1251_python-basics.html</comments>
   <guid>http://muthuvel-pythonblog.pythonblogs.com/207_muthuvel-pythonblog/archive/1251_python-basics.html</guid>
      <author>muthuvel</author>
   <category>
           General 
        </category>
   <source url="http://muthuvel-pythonblog.pythonblogs.com/207_muthuvel-pythonblog/feeds/rss20">muthuvel-PythonBlog</source>
  </item>
          
  <item>
   <title>PYGTK?</title>
   <description>For the application I will be using Aptana 3 as my IDE. I have used gedit but I want to wallow around in something that makes me feel more professional. I will be using PYGTK to handle my GUI needs. I would like to approach this using MVC methods. I suppose I should start with my model first. Any ideas?</description>
   <link>http://skink-py.pythonblogs.com/179_skink_py/archive/1030_pygtk.html</link>
   <comments>http://skink-py.pythonblogs.com/179_skink_py/archive/1030_pygtk.html</comments>
   <guid>http://skink-py.pythonblogs.com/179_skink_py/archive/1030_pygtk.html</guid>
      <author>rbwilkinson</author>
   <category>
           General 
        </category>
   <source url="http://skink-py.pythonblogs.com/179_skink_py/feeds/rss20">Skink Py</source>
  </item>
          
  <item>
   <title>File for Copying the Directory to other location which the user can specify</title>
   <description>&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;import sys&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;import os&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;import tkMessageBox&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;from Tkinter import *&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;from tkCommonDialog import Dialog&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;import shutil&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;import tkFileDialog&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;import win32com.client&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;&lt;br /&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;win = Tk()&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;win.title(&quot;Copying the Directory to specified location&quot;)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;win.geometry(&quot;600x600+200+50&quot;)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;win.resizable()&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;src = &#039;&#039;&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;des= &#039;&#039; &lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;class Copy():&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;    &lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;    def __init__(self):&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        def srce():&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;            src = tkFileDialog.askdirectory(title = &quot;The source folder is &quot;)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;            textboxsrc.delete(0,END)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;            textboxsrc.insert(0,src)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;            print src&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;            return src&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        &lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        textboxsrc = Entry(win, width=&quot;70&quot;)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        textboxsrc.insert(0,&#039;Enter master file name&#039;)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        textboxsrc.pack()&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        textboxsrc.place(relx=0.40, rely=0.06, anchor=CENTER)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        bu = Button(text = &quot;Source&quot;,font = &quot;Verdana 12 italic bold&quot;,bg = &quot;Purple&quot;,fg= &quot;white&quot;, command= srce)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        bu.pack(fill =X, expand=YES)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        bu.place(relx=0.85, rely=0.06, anchor=CENTER)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;&lt;br /&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        def dest():&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;            des = tkFileDialog.askdirectory(title = &quot;TheDestination folder is &quot;)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;            textboxdes.delete(0,END)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;            textboxdes.insert(0,des)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;            print des&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;            return des&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;                    &lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        textboxdes = Entry(win, width=&quot;70&quot;)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        textboxdes.insert(0,&#039;Enter master file name&#039;)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        textboxdes.pack()&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        textboxdes.place(relx=0.40, rely=0.13, anchor=CENTER)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        bu1 = Button(text = &quot;Destination&quot;,font = &quot;Verdana 12 italic&quot;,bg = &quot;Purple&quot;,fg= &quot;white&quot;, command= dest)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        bu1.pack(fill =X, expand=YES)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        bu1.place(relx=0.85, rely=0.13, anchor=CENTER)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;&lt;br /&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;&lt;br /&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;    def start():&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        &lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        #try:&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        shutil.copytree(src,des)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        #except :&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;            #tkMessageBox.showwarning(&quot;Copying file&quot;,  &quot;Error while copying\n(%s)&quot; )&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;        &lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;    bn =Button(text = &quot;Copy&quot;,font = &quot;Verdana 12 italic&quot;, bg = &quot;Purple&quot;,fg= &quot;white&quot;,command=start)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;    bn.pack(fill =X, expand = YES)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;    bn.place(relx=0.50, rely=0.25, anchor=CENTER)&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;&lt;br /&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;    &lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;obj= Copy()&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;&lt;br /&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;&lt;br /&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-family: verdana, geneva&quot;&gt;win.mainloop()&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;/div&gt;</description>
   <link>http://concepts4u.pythonblogs.com/166_concepts4u/archive/801_file_for_copying_the_directory_to_other_location_which_the_user_can_specify.html</link>
   <comments>http://concepts4u.pythonblogs.com/166_concepts4u/archive/801_file_for_copying_the_directory_to_other_location_which_the_user_can_specify.html</comments>
   <guid>http://concepts4u.pythonblogs.com/166_concepts4u/archive/801_file_for_copying_the_directory_to_other_location_which_the_user_can_specify.html</guid>
      <author>bharath6725</author>
   <category>
           General 
        </category>
   <source url="http://concepts4u.pythonblogs.com/166_concepts4u/feeds/rss20">Concepts4u</source>
  </item>
          
  <item>
   <title>&amp;#1044;&amp;#1086;&amp;#1073;&amp;#1072;&amp;#1074;&amp;#1083;&amp;#1077;&amp;#1085;&amp;#1080;&amp;#1077; &amp;#1101;&amp;#1083;&amp;#1077;&amp;#1084;&amp;#1077;&amp;#1085;&amp;#1090;&amp;#1072; &amp;#1074; &amp;#1089;&amp;#1087;&amp;#1080;&amp;#1089;&amp;#1086;&amp;#1082; &amp;#1085;&amp;#1077;&amp;#1091;&amp;#1085;&amp;#1080;&amp;#1082;&amp;#1072;&amp;#1083;&amp;#1100;&amp;#1085;&amp;#1099;&amp;#1093; &amp;#1089;&amp;#1080;&amp;#1084;&amp;#1074;&amp;#1086;&amp;#1083;&amp;#1086;&amp;#1074; &amp;#1055;&amp;#1045;&amp;#1056;&amp;#1045;&amp;#1044; &amp;#1089;&amp;#1080;&amp;#1084;&amp;#1074;&amp;#1086;&amp;#1083;&amp;#1086;&amp;#1084; &amp;#1080; &amp;#1055;&amp;#1054;&amp;#1057;&amp;#1051;&amp;#1045;</title>
   <description>&lt;p&gt;
&amp;#1055;&amp;#1086;&amp;#1085;&amp;#1072;&amp;#1076;&amp;#1086;&amp;#1073;&amp;#1080;&amp;#1083;&amp;#1086;&amp;#1089;&amp;#1100; &amp;#1074; &amp;#1088;&amp;#1072;&amp;#1073;&amp;#1086;&amp;#1090;&amp;#1077; &amp;#1080; &amp;#1087;&amp;#1086;&amp;#1084;&amp;#1085;&amp;#1102;, &amp;#1095;&amp;#1090;&amp;#1086; &amp;#1087;&amp;#1088;&amp;#1080;&amp;#1075;&amp;#1086;&amp;#1076;&amp;#1080;&amp;#1083;&amp;#1086;&amp;#1089;&amp;#1100; &amp;#1073;&amp;#1099; &amp;#1088;&amp;#1072;&amp;#1085;&amp;#1077;&amp;#1077;, &amp;#1085;&amp;#1086; &amp;#1087;&amp;#1088;&amp;#1086;&amp;#1089;&amp;#1090;&amp;#1086; &amp;#1085;&amp;#1077; &amp;#1073;&amp;#1099;&amp;#1083;&amp;#1086; &amp;#1074;&amp;#1088;&amp;#1077;&amp;#1084;&amp;#1077;&amp;#1085;&amp;#1080; &amp;#1087;&amp;#1088;&amp;#1080;&amp;#1076;&amp;#1091;&amp;#1084;&amp;#1072;&amp;#1090;&amp;#1100;, &amp;#1086;&amp;#1090;&amp;#1090;&amp;#1077;&amp;#1089;&amp;#1090;&amp;#1080;&amp;#1090;&amp;#1100; &amp;#1080; &amp;#1086;&amp;#1090;&amp;#1076;&amp;#1072;&amp;#1083;&amp;#1080;&amp;#1090;&amp;#1100;.
&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;
&lt;strong&gt;&amp;#1044;&amp;#1086;&amp;#1073;&amp;#1072;&amp;#1074;&amp;#1083;&amp;#1077;&amp;#1085;&amp;#1080;&amp;#1077; &amp;#1101;&amp;#1083;&amp;#1077;&amp;#1084;&amp;#1077;&amp;#1085;&amp;#1090;&amp;#1072; &amp;#1074; &amp;#1089;&amp;#1087;&amp;#1080;&amp;#1089;&amp;#1086;&amp;#1082; &amp;#1085;&amp;#1077;&amp;#1091;&amp;#1085;&amp;#1080;&amp;#1082;&amp;#1072;&amp;#1083;&amp;#1100;&amp;#1085;&amp;#1099;&amp;#1093; &amp;#1089;&amp;#1080;&amp;#1084;&amp;#1074;&amp;#1086;&amp;#1083;&amp;#1086;&amp;#1074; &amp;#1055;&amp;#1045;&amp;#1056;&amp;#1045;&amp;#1044; &amp;#1089;&amp;#1080;&amp;#1084;&amp;#1074;&amp;#1086;&amp;#1083;&amp;#1086;&amp;#1084;:&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
[code python]&lt;br /&gt;
class Before(list):
    def __init__(self, *args, **kwargs):
        super(Before, self).__init__(*args, **kwargs)
        self.check()
    def check(self):
        index = 0
        while index != len(self):
            a = self[index]
            if a == &quot;a&quot;:
                self.insert(index, &quot;!&quot;)
                index += 2
            else:
                index += 1 &lt;br /&gt;
[/code]
&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;
&lt;strong&gt;&amp;#1044;&amp;#1086;&amp;#1073;&amp;#1072;&amp;#1074;&amp;#1083;&amp;#1077;&amp;#1085;&amp;#1080;&amp;#1077; &amp;#1101;&amp;#1083;&amp;#1077;&amp;#1084;&amp;#1077;&amp;#1085;&amp;#1090;&amp;#1072; &amp;#1074; &amp;#1089;&amp;#1087;&amp;#1080;&amp;#1089;&amp;#1086;&amp;#1082; &amp;#1085;&amp;#1077;&amp;#1091;&amp;#1085;&amp;#1080;&amp;#1082;&amp;#1072;&amp;#1083;&amp;#1100;&amp;#1085;&amp;#1099;&amp;#1093; &amp;#1089;&amp;#1080;&amp;#1084;&amp;#1074;&amp;#1086;&amp;#1083;&amp;#1086;&amp;#1074; &amp;#1055;&amp;#1054;&amp;#1057;&amp;#1051;&amp;#1045; &amp;#1089;&amp;#1080;&amp;#1084;&amp;#1074;&amp;#1086;&amp;#1083;&amp;#1072;:&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
[code python]&lt;br /&gt;
class After(list):&lt;br /&gt;
    def __init__(self, *args, **kwargs):&lt;br /&gt;
        super(After, self).__init__(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
        self.check()&lt;br /&gt;
&lt;br /&gt;
    def check(self):&lt;br /&gt;
        for index, member in enumerate(self):&lt;br /&gt;
            if member == &quot;a&quot;:&lt;br /&gt;
                self.insert(index + 1, &quot;!&quot;)&lt;br /&gt;
[/code] 
&lt;/p&gt;</description>
   <link>http://python-snippets.pythonblogs.com/147_python_snippets/archive/509_1044108610731072107410831077108510801077_11011083107710841077108510901072_1074_108910871080108910861082_108510771091108510801082107210831100108510991093_10891080108410741086108310861074_10551045105610451044_10891080108410741086108310861084_1080_10551054105710511045.html</link>
   <comments>http://python-snippets.pythonblogs.com/147_python_snippets/archive/509_1044108610731072107410831077108510801077_11011083107710841077108510901072_1074_108910871080108910861082_108510771091108510801082107210831100108510991093_10891080108410741086108310861074_10551045105610451044_10891080108410741086108310861084_1080_10551054105710511045.html</comments>
   <guid>http://python-snippets.pythonblogs.com/147_python_snippets/archive/509_1044108610731072107410831077108510801077_11011083107710841077108510901072_1074_108910871080108910861082_108510771091108510801082107210831100108510991093_10891080108410741086108310861074_10551045105610451044_10891080108410741086108310861084_1080_10551054105710511045.html</guid>
      <author>snippets</author>
   <category>
           General 
        </category>
   <source url="http://python-snippets.pythonblogs.com/147_python_snippets/feeds/rss20">Python Snippets</source>
  </item>
          
  <item>
   <title>Timer Help Python 2.5</title>
   <description>&lt;p&gt;
Does anyone know how to make a Timer function in Python 2.5. Cancel or .cancel() only stops the Timer while in execution, but how do you stop the Timer or threading after execution is finished.  This is what I made for a timer, but it locks up the program. 
&lt;/p&gt;
&lt;p&gt;
def main():&lt;br /&gt;
    import time&lt;br /&gt;
    import threading&lt;br /&gt;
    global time&lt;br /&gt;
    global threading&lt;br /&gt;
    global stoneskinT&lt;br /&gt;
    &lt;br /&gt;
    stoneskinT = threading.Timer(5.0, stoneskin)&lt;br /&gt;
    stoneskinT.start()&lt;br /&gt;
    string = raw_input (&quot;... &quot;)&lt;br /&gt;
    stoneskinT.cancel() 
&lt;/p&gt;
&lt;p&gt;
    while (string == &quot;&quot;):&lt;br /&gt;
        stoneskinT = threading.Timer(5.0, stoneskin)&lt;br /&gt;
        stoneskinT.start()&lt;br /&gt;
        string = raw_input (&quot;... &quot;)&lt;br /&gt;
        stoneskinT.cancel()&lt;br /&gt;
        &lt;br /&gt;
def stoneskin():&lt;br /&gt;
    global string&lt;br /&gt;
    global stoneskinT    &lt;br /&gt;
    print &quot;Potion of stoneskin has worn off.&quot;&lt;br /&gt;
    string = raw_input (&quot;... &quot;)&lt;br /&gt;
main() 
&lt;/p&gt;</description>
   <link>http://timer-help.pythonblogs.com/133_timer_help/archive/480_timer_help_python_25.html</link>
   <comments>http://timer-help.pythonblogs.com/133_timer_help/archive/480_timer_help_python_25.html</comments>
   <guid>http://timer-help.pythonblogs.com/133_timer_help/archive/480_timer_help_python_25.html</guid>
      <author>mike</author>
   <category>
           General 
        </category>
   <source url="http://timer-help.pythonblogs.com/133_timer_help/feeds/rss20">Timer Help</source>
  </item>
          
  <item>
   <title>Random Password Generation in Python</title>
   <description>&lt;h4 class=&quot;post-title&quot;&gt;&lt;a href=&quot;http://www.myspace.com/hayathms/blog/542645124&quot; title=&quot;Read Auto Password Generating In Python&quot; rel=&quot;bookmark&quot;&gt;Auto Password Generating In Python&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;
&lt;span style=&quot;font-size: small; color: #ff6600&quot;&gt;Here is the code for simple auto password generating in python using any string like first name, or username or anything .&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: medium; color: #339966&quot;&gt;import random&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;font-size: medium; color: #339966&quot;&gt;&lt;br /&gt;
def gen_random_password(string_letters):&lt;br /&gt;
    string_letters = string_letters.replace(&#039; &#039;,&#039;&#039;)&lt;br /&gt;
    string_letters = string_letters.replace(&#039;.&#039;,&#039;&#039;)&lt;br /&gt;
    a = random.choice(string_letters)&lt;br /&gt;
    b = random.choice(string_letters)&lt;br /&gt;
    c = random.choice(string_letters)&lt;br /&gt;
    d = random.choice(string_letters)&lt;br /&gt;
    e = str(random.randint(100,500))&lt;br /&gt;
    f = str(random.randint(500,1000))&lt;br /&gt;
    return a+e+b+f+c+d]&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
And Please comment me how strong password can be generated using my above code. :) 
&lt;/p&gt;</description>
   <link>http://my-python-codes.pythonblogs.com/128_my_python_codes/archive/474_random_password_generation_in_python.html</link>
   <comments>http://my-python-codes.pythonblogs.com/128_my_python_codes/archive/474_random_password_generation_in_python.html</comments>
   <guid>http://my-python-codes.pythonblogs.com/128_my_python_codes/archive/474_random_password_generation_in_python.html</guid>
      <author>hayathms</author>
   <category>
           General 
        </category>
   <source url="http://my-python-codes.pythonblogs.com/128_my_python_codes/feeds/rss20">My Python Codes</source>
  </item>
          
  <item>
   <title>Artist new release search program</title>
   <description>&lt;p&gt;This is the first program I&#039;ve written that has actually served a real purpose to me, that I use frequently. Feel free to criticize and make any suggestions or corrections, because the code is probably pretty ugly. I hope it&#039;s readable. The program searches for the newest release of whatever electronic music artist you specify from trackitdown.net. Keep in mind please, that I&#039;m a total python noob.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;#!/usr/bin/python&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;from urllib import urlopen&lt;/p&gt;&lt;p&gt;from subprocess import call&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;print &quot;\n+++++++++++++++++++++++++++++++++++++++++++++++++++++&quot;&lt;/p&gt;&lt;p&gt;print &quot;Artist new release search v1.0&quot;&lt;/p&gt;&lt;p&gt;print &quot;This program utilizes www.trackitdown.net for results&quot;&lt;/p&gt;&lt;p&gt;print &quot;+++++++++++++++++++++++++++++++++++++++++++++++++++++\n&quot;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;try:&lt;/p&gt;&lt;p&gt;  def artist_search():&lt;/p&gt;&lt;p&gt;    try:&lt;/p&gt;&lt;p&gt;      try:&lt;/p&gt;&lt;p&gt;        artist = raw_input(&#039;\nEnter artist name: &#039;)&lt;/p&gt;&lt;p&gt;        print &quot;\nSearching...&quot;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;        website = urlopen(&#039;http://www.trackitdown.net/search/advanced?artist=&#039; + artist)&lt;/p&gt;&lt;p&gt;        text = website.read()&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;        import re&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;        artist = re.search(&#039;Artist: &amp;lt;a href=&quot;/artist/([^&quot;]+)&quot; title=&quot;([^&quot;]+)&quot;&amp;gt;([^&quot;]+)&amp;lt;/a&amp;gt;&#039;, text, re.IGNORECASE)&lt;/p&gt;&lt;p&gt;        artist.group(1)&lt;/p&gt;&lt;p&gt;        track = re.search(&#039;&amp;lt;a href=&quot;/genre/([^&quot;]+)/track/([^&quot;]+).html&quot;&amp;gt;&amp;lt;strong&amp;gt;([^&quot;]+)&amp;lt;/strong&amp;gt;&#039;, text, re.IGNORECASE)&lt;/p&gt;&lt;p&gt;        track.group(1)&lt;/p&gt;&lt;p&gt;        date = re.search(&#039;release date: ([^&quot;]+)&amp;lt;br /&amp;gt;&#039;, text, re.IGNORECASE)&lt;/p&gt;&lt;p&gt;        date.group(1)&lt;/p&gt;&lt;p&gt;        urlpreview = re.search(&#039;&amp;lt;a href=&quot;([^&quot;]+).mp3&quot;&#039;, text, re.IGNORECASE)&lt;/p&gt;&lt;p&gt;        url = urlpreview.group(1)&lt;/p&gt;&lt;p&gt;      except AttributeError: print &#039;\nNo artist found! Exiting...&#039;, quit()&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;      print &quot;\nFound result!&quot;&lt;/p&gt;&lt;p&gt;      print &quot;\n======================================&quot;&lt;/p&gt;&lt;p&gt;      print &quot;Artist: &quot; + artist.group(3)&lt;/p&gt;&lt;p&gt;      print &quot;Track name: &quot; + track.group(3)&lt;/p&gt;&lt;p&gt;      print &quot;Release date: &quot; + date.group(1)&lt;/p&gt;&lt;p&gt;      print &quot;======================================\n&quot;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;      try:&lt;/p&gt;&lt;p&gt;        print &quot;\nPreview at: &quot; + urlpreview.group(1) + &quot;.mp3&quot;&lt;/p&gt;&lt;p&gt;        preview = raw_input(&#039;Play preview? y/n: &#039;)&lt;/p&gt;&lt;p&gt;        if preview == &#039;y&#039; : call([&#039;mpg123&#039;, url + &quot;.mp3&quot;])&lt;/p&gt;&lt;p&gt;        if preview == &#039;n&#039; : print &quot;Exiting...&quot;, quit()&lt;/p&gt;&lt;p&gt;      except OSError: print &quot;Looks like you don&#039;t have mpg123 installed! Exiting...&quot;, quit()&lt;/p&gt;&lt;p&gt;    except KeyboardInterrupt: search_again = raw_input(&quot;\nWould you like to perform another search? y/n: &quot;)&lt;/p&gt;&lt;p&gt;    if search_again == &quot;n&quot; : print &#039;Exiting...&#039;, quit()&lt;/p&gt;&lt;p&gt;    if search_again == &quot;y&quot; : artist_search()&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;  artist_search()&lt;/p&gt;&lt;p&gt;except UnboundLocalError: print &quot;\n&quot;, artist_search() &lt;/p&gt;</description>
   <link>http://aashift.pythonblogs.com/120_aashift/archive/463_artist_new_release_search_program.html</link>
   <comments>http://aashift.pythonblogs.com/120_aashift/archive/463_artist_new_release_search_program.html</comments>
   <guid>http://aashift.pythonblogs.com/120_aashift/archive/463_artist_new_release_search_program.html</guid>
      <author>tomsimmons</author>
   <category>
           General 
        </category>
   <source url="http://aashift.pythonblogs.com/120_aashift/feeds/rss20">aashift</source>
  </item>
   </channel>
</rss>