<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5309403273623549307</id><updated>2014-05-25T19:11:01.587-03:00</updated><category term="escritos"/><category term="programacion"/><category term="python"/><category term="gcoop"/><category term="linux"/><category term="buenos aires"/><category term="diy"/><category term="joac"/><category term="laptop"/><category term="tryton"/><category term="xml"/><category term="OPC"/><category term="arte electronico"/><category term="bariloche"/><category term="blogger"/><category term="cafelug"/><category term="conferencias"/><category term="cooling"/><category term="creatividad"/><category term="dell"/><category term="gmail"/><category term="guitarra"/><category term="javascript"/><category term="micros"/><category term="modbus"/><category term="proyectos"/><category term="pyconar2009"/><category term="router"/><category term="windows"/><title type='text'>.:::Joaclandia:::.</title><subtitle type='html'>Peleando con el Samborondrolo</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.joaclandia.com.ar/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/-/python'/><link rel='alternate' type='text/html' href='http://www.joaclandia.com.ar/search/label/python'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Joac</name><uri>http://www.blogger.com/profile/02027757346242312656</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5309403273623549307.post-7860028040453419332</id><published>2013-06-05T14:23:00.001-03:00</published><updated>2013-06-05T14:23:22.379-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="gcoop"/><category scheme="http://www.blogger.com/atom/ns#" term="programacion"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="tryton"/><category scheme="http://www.blogger.com/atom/ns#" term="xml"/><title type='text'>Zafá del xml con Tryton Builder!</title><content type='html'>Hay cosas que no me gustan, y hay cosas que detesto. En esa escala de valores, en el primer lugar está PHP y en el segundo los XMLs. Como &lt;a href=&quot;http://www.joaclandia.com.ar/2013/06/monkey-patcheando-element-tree-para.html&quot; target=&quot;_blank&quot;&gt;conté en el post anterior&lt;/a&gt;, estoy desarrollando algunos&amp;nbsp;módulos&amp;nbsp;para&amp;nbsp;&lt;a href=&quot;http://www.tryton.org/&quot; target=&quot;_blank&quot;&gt;Tryton&lt;/a&gt;, que define sus vistas, y elementos de&amp;nbsp;interacción&amp;nbsp;usando ese lenguaje de markup.&lt;br /&gt;&lt;br /&gt;Hay varios&amp;nbsp;artículos&amp;nbsp;que hablan que uno tiene que&lt;a href=&quot;http://blogoscoped.com/archive/2005-08-24-n14.html&quot; target=&quot;_blank&quot;&gt; ser un programador vago&lt;/a&gt;, yo estoy totalmente de acuerdo con que hay que ser un programador que automatiza al&amp;nbsp;máximo&amp;nbsp;el trabajo que no le gusta hacer, para poder dedicar el tiempo a problemas mas complicados o atractivos, o a mirar por la ventana.&lt;br /&gt;&lt;br /&gt;En mi intento por zafar de escribir varios cientos de &amp;nbsp;&#39;&amp;lt;&#39;,&#39; /&#39;, y &#39;&amp;gt;&#39; a mano nació &lt;a href=&quot;https://github.com/joac/tryton_builder&quot; target=&quot;_blank&quot;&gt;Tryton Builder &lt;/a&gt;(Que tiene logo y todo!)&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://raw.github.com/joac/tryton_builder/master/data/logo.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://raw.github.com/joac/tryton_builder/master/data/logo.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Por el momento, para generar un módulo, hay que escribir un pequeño archivo de&amp;nbsp;código&amp;nbsp;(Si, es código python, porque me gusta programar, no parametrizar, yamls, csv, y ese tipo de cosas) de este estilo:&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;script src=&quot;https://gist.github.com/joac/5715573.js&quot;&gt;&lt;/script&gt;  En el ejemplo, estoy realizando todos los pasos para generar el modulo de ejemplo del &lt;a href=&quot;http://code.google.com/p/tryton/wiki/HelloWorld&quot; target=&quot;_blank&quot;&gt;wiki de tryton&lt;/a&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Solo para comparar la diferencia de caracteres escritos versus generados:&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;script src=&quot;https://gist.github.com/joac/5715603.js&quot;&gt;&lt;/script&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;El proximo paso, es armar una interfaz de consola como la de los scaffolders de Ruby On Rails&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href=&quot;https://raw.github.com/joac/tryton_builder/master/data/logo.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;a href=&quot;https://raw.github.com/joac/tryton_builder/master/data/logo.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a rel=&quot;license&quot; href=&quot;http://creativecommons.org/licenses/by-nc-sa/2.5/ar/&quot;&gt;Contenido bajo licencia Creative Commons by-nc-sa&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.joaclandia.com.ar/feeds/7860028040453419332/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5309403273623549307&amp;postID=7860028040453419332' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/7860028040453419332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/7860028040453419332'/><link rel='alternate' type='text/html' href='http://www.joaclandia.com.ar/2013/06/zafa-del-xml-con-tryton-builder.html' title='Zafá del xml con Tryton Builder!'/><author><name>Joaquín Sorianello</name><uri>https://plus.google.com/113288886837539699792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-ogt-kME7EYc/AAAAAAAAAAI/AAAAAAAAABQ/kOlaCvsLPAI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5309403273623549307.post-9164636317193787622</id><published>2013-06-04T14:04:00.000-03:00</published><updated>2013-06-04T14:04:06.557-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="gcoop"/><category scheme="http://www.blogger.com/atom/ns#" term="programacion"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="tryton"/><category scheme="http://www.blogger.com/atom/ns#" term="xml"/><title type='text'>Monkey Patcheando Element tree para soportar cdata</title><content type='html'>Hace un tiempo que estoy trabajando con Tryton, el ERP libre, escrito en python, y como me gustan los scaffolders de Rails,&amp;nbsp;decidí&amp;nbsp;escribir uno para armar los esqueletos de los&amp;nbsp;módulos.  Tryton, no se bien por que motivo, utiliza mucho xml, para definir vistas, y fixtures de datos. Como me gusta programar en python, me empezé a escribir una especie de DSL para definirlos de una manera mas amigable:&lt;br /&gt;&lt;a href=&quot;https://github.com/joac/tryton_builder&quot; target=&quot;_blank&quot;&gt;https://github.com/joac/tryton_builder&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Python permite trabajar con xml con un&amp;nbsp;montón&amp;nbsp;de bibliotecas distintas, pero las mas amigable de usar, para mi es ElementTree&lt;br /&gt;&lt;br /&gt;Cuando empece a escribir el codigo, y hacer pruebas, me&amp;nbsp;encontré&amp;nbsp;con varios problemas, el primero, ElementTree no tiene &quot;Pritty Print&quot;&lt;br /&gt;para que el xml generado sea mas&amp;nbsp;cómodo&amp;nbsp;de leer, por suerte&amp;nbsp;encontré&amp;nbsp;esta receta: &lt;br /&gt;&lt;br /&gt;&lt;script src=&quot;https://gist.github.com/joac/5707530.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;en&amp;nbsp;&lt;a href=&quot;http://effbot.org/zone/element-lib.htm#prettyprint&quot;&gt;http://effbot.org/zone/element-lib.htm#prettyprint&lt;/a&gt;&amp;nbsp;que resolvió correctamente el problema&lt;br /&gt;&lt;br /&gt;Avanzando en el diseño de los scaffolders me encontré con otra&amp;nbsp;limitación&amp;nbsp; ElementTree no soporta el tag CDATA. Usted podria preguntarse &quot;&lt;a href=&quot;http://en.wikipedia.org/wiki/CDATA&quot; target=&quot;_blank&quot;&gt;¿Que es el tag CDATA?&lt;/a&gt;&quot;,&amp;nbsp;Básicamente&amp;nbsp;un tag que le dice al parser &quot;Lo que esta aca adentro es un conjunto de caracteres, no lo parsees&quot;&lt;br /&gt;Si bien se puede evitar el uso del tag, ingresando el texto escapado (por ejemplo, en lugar de &#39;&amp;gt;&#39; escribir &#39;&amp;amp;gt&#39; ) el objetivo es que el XML no deje de ser legible,&amp;nbsp;encontré&amp;nbsp;otras recetas en StackOverflow:&lt;br /&gt;&lt;a href=&quot;http://stackoverflow.com/questions/174890/how-to-output-cdata-using-elementtree&quot;&gt;http://stackoverflow.com/questions/174890/how-to-output-cdata-using-elementtree&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Pero finalmente,&amp;nbsp;decidí&amp;nbsp;escribir mi propia&amp;nbsp;versión&amp;nbsp;basada en algunos de los comentarios (la receta con mas votos no funciona en python 2.7+) &lt;br /&gt;&lt;br /&gt;&lt;script src=&quot;https://gist.github.com/joac/5707442.js&quot;&gt;&lt;/script&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a rel=&quot;license&quot; href=&quot;http://creativecommons.org/licenses/by-nc-sa/2.5/ar/&quot;&gt;Contenido bajo licencia Creative Commons by-nc-sa&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.joaclandia.com.ar/feeds/9164636317193787622/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5309403273623549307&amp;postID=9164636317193787622' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/9164636317193787622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/9164636317193787622'/><link rel='alternate' type='text/html' href='http://www.joaclandia.com.ar/2013/06/monkey-patcheando-element-tree-para.html' title='Monkey Patcheando Element tree para soportar cdata'/><author><name>Joaquín Sorianello</name><uri>https://plus.google.com/113288886837539699792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-ogt-kME7EYc/AAAAAAAAAAI/AAAAAAAAABQ/kOlaCvsLPAI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5309403273623549307.post-455014781117265359</id><published>2011-09-30T16:09:00.000-03:00</published><updated>2011-09-30T16:09:03.455-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="arte electronico"/><category scheme="http://www.blogger.com/atom/ns#" term="gcoop"/><category scheme="http://www.blogger.com/atom/ns#" term="programacion"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Up things</title><content type='html'>Después de la charla de&lt;a href=&quot;http://www.canonical.org/%7Ekragen/&quot;&gt; Kragen Javier Sitaker&lt;/a&gt; en &lt;a href=&quot;http://ar.pycon.org/2011&quot;&gt;Pyconar 2011&lt;/a&gt; me puse a trabajar en algunas obras de arte electrónico. &lt;br /&gt;&lt;br /&gt;Así nació &lt;a href=&quot;https://github.com/joac/Up_Things&quot;&gt;Up things&lt;/a&gt; (no pregunten el porque del nombre ), un repositorio en github&amp;nbsp; donde voy poniendo las cosas que se me ocurren.&lt;br /&gt;&lt;br /&gt;El primer proyecto es el lanzador de partículas. Les dejo unos screenshots:&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/-OQAtPZf-AwU/ToYS_HeagMI/AAAAAAAAAVk/rlYX7J-JyiA/s1600/2011-09-30-160732_1600x900_scrot.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;360&quot; src=&quot;http://4.bp.blogspot.com/-OQAtPZf-AwU/ToYS_HeagMI/AAAAAAAAAVk/rlYX7J-JyiA/s640/2011-09-30-160732_1600x900_scrot.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/-GAgGiu-Wpi0/ToYTBqLhLHI/AAAAAAAAAVo/_JeMrSsV7sk/s1600/2011-09-30-160750_1600x900_scrot.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;360&quot; src=&quot;http://4.bp.blogspot.com/-GAgGiu-Wpi0/ToYTBqLhLHI/AAAAAAAAAVo/_JeMrSsV7sk/s640/2011-09-30-160750_1600x900_scrot.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/-ZaaMVd9xs8Q/ToYTD8zZ8PI/AAAAAAAAAVs/Z2LUVlygbio/s1600/2011-09-30-160815_1600x900_scrot.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;360&quot; src=&quot;http://4.bp.blogspot.com/-ZaaMVd9xs8Q/ToYTD8zZ8PI/AAAAAAAAAVs/Z2LUVlygbio/s640/2011-09-30-160815_1600x900_scrot.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a rel=&quot;license&quot; href=&quot;http://creativecommons.org/licenses/by-nc-sa/2.5/ar/&quot;&gt;Contenido bajo licencia Creative Commons by-nc-sa&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.joaclandia.com.ar/feeds/455014781117265359/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5309403273623549307&amp;postID=455014781117265359' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/455014781117265359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/455014781117265359'/><link rel='alternate' type='text/html' href='http://www.joaclandia.com.ar/2011/09/up-things.html' title='Up things'/><author><name>Joac</name><uri>http://www.blogger.com/profile/02027757346242312656</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-OQAtPZf-AwU/ToYS_HeagMI/AAAAAAAAAVk/rlYX7J-JyiA/s72-c/2011-09-30-160732_1600x900_scrot.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5309403273623549307.post-5902858627866451275</id><published>2010-10-03T20:12:00.000-03:00</published><updated>2010-10-03T20:12:41.729-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="gcoop"/><category scheme="http://www.blogger.com/atom/ns#" term="programacion"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Puertos Serie Virtuales en Gnu/Linux</title><content type='html'>Hoy estaba preparando mi charla para la PyCon2010 y me vi con la  necesidad de crear puertos serie virtuales, para unos ejemplos que  quiero dar...&lt;br /&gt;&lt;br /&gt;La solución fue utilizar socat:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&quot;Socat&amp;nbsp; is a command line based utility that establishes two bidirectional byte streams and transfers data between them. Because the streams can be constructed from&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a large set of different types of data sinks and sources (see address types), and because lots of address options may be applied to the streams, socat can be&amp;nbsp; used&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for many different purposes.&quot;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;La linea en cuestión:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;joac@pepino ~ $ socat PTY,link=vserial1 PTY,link=vserial2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Despues, desde pyserial, por ejemplo nos conectamos con:&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;import serial&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;ser = serial.Serial(&quot;/home/joac/vserial1&quot;)&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a rel=&quot;license&quot; href=&quot;http://creativecommons.org/licenses/by-nc-sa/2.5/ar/&quot;&gt;Contenido bajo licencia Creative Commons by-nc-sa&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.joaclandia.com.ar/feeds/5902858627866451275/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5309403273623549307&amp;postID=5902858627866451275' title='1 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/5902858627866451275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/5902858627866451275'/><link rel='alternate' type='text/html' href='http://www.joaclandia.com.ar/2010/10/puertos-serie-virtuales-en-gnulinux.html' title='Puertos Serie Virtuales en Gnu/Linux'/><author><name>Joac</name><uri>http://www.blogger.com/profile/02027757346242312656</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5309403273623549307.post-7172692726855469100</id><published>2010-07-17T13:01:00.003-03:00</published><updated>2010-07-17T15:27:00.032-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="gcoop"/><category scheme="http://www.blogger.com/atom/ns#" term="programacion"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Jueguito v2</title><content type='html'>Ayer empecé el proyecto de un minijuego, clón de uno de blackberry.&lt;br /&gt;Me di cuenta que sin colores era injugable, así que me puse a investigar como agregar colores a los prints de python, y me encontré con [1] en Stack Overflow, que explica como hacerlo.&lt;br /&gt;&lt;br /&gt;Es muy fácil, con la salvedad que yo aproveche y cambié el color de fondo, en lugar del color del texto.&lt;br /&gt;&lt;br /&gt;Ahora es mas cómodo de jugar. &lt;br /&gt;&lt;br /&gt;La ultima versión (Provisoria) la encuentran en [2] &lt;br /&gt;&lt;br /&gt;[1] &lt;a href=&quot;http://stackoverflow.com/questions/287871/print-in-terminal-with-colors-using-python&quot;&gt;http://stackoverflow.com/questions/287871/print-in-terminal-with-colors-using-python&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;[2]&lt;a href=&quot;http://github.com/joac/joac-python/blob/master/minigame/minigame.py&quot;&gt; http://github.com/joac/joac-python/blob/master/minigame/minigame.py&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;Dejo unas capturas que hice:&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/_chPCPdSVRNw/TEHzmHlUJvI/AAAAAAAAAQo/PYOwqfUUnW0/s1600/captura1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;317&quot; src=&quot;http://4.bp.blogspot.com/_chPCPdSVRNw/TEHzmHlUJvI/AAAAAAAAAQo/PYOwqfUUnW0/s320/captura1.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&amp;nbsp;&lt;i&gt;El inicio del juego&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/_chPCPdSVRNw/TEHz8KupYXI/AAAAAAAAAQw/C9ssPxLSbEI/s1600/captura2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://1.bp.blogspot.com/_chPCPdSVRNw/TEHz8KupYXI/AAAAAAAAAQw/C9ssPxLSbEI/s320/captura2.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;i&gt;Un par de jugadas despues&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://2.bp.blogspot.com/_chPCPdSVRNw/TEH0JPrStbI/AAAAAAAAAQ4/qdBYBI2PnTU/s1600/captura3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://2.bp.blogspot.com/_chPCPdSVRNw/TEH0JPrStbI/AAAAAAAAAQ4/qdBYBI2PnTU/s320/captura3.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;i&gt;Ganamos!&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/_chPCPdSVRNw/TEH0VdXu4pI/AAAAAAAAARA/ziswS19uT9U/s1600/captura4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://3.bp.blogspot.com/_chPCPdSVRNw/TEH0VdXu4pI/AAAAAAAAARA/ziswS19uT9U/s320/captura4.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;i&gt;Si no alcanzan los movimientos... Nos espera la derrota&lt;/i&gt;&lt;/div&gt;&lt;a href=&quot;http://github.com/joac/joac-python/blob/master/minigame.py&quot;&gt; &lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a rel=&quot;license&quot; href=&quot;http://creativecommons.org/licenses/by-nc-sa/2.5/ar/&quot;&gt;Contenido bajo licencia Creative Commons by-nc-sa&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.joaclandia.com.ar/feeds/7172692726855469100/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5309403273623549307&amp;postID=7172692726855469100' title='2 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/7172692726855469100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/7172692726855469100'/><link rel='alternate' type='text/html' href='http://www.joaclandia.com.ar/2010/07/jueguito-v2.html' title='Jueguito v2'/><author><name>Joac</name><uri>http://www.blogger.com/profile/02027757346242312656</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_chPCPdSVRNw/TEHzmHlUJvI/AAAAAAAAAQo/PYOwqfUUnW0/s72-c/captura1.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5309403273623549307.post-78659823185813234</id><published>2010-07-16T22:12:00.002-03:00</published><updated>2010-07-17T13:04:41.162-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="gcoop"/><category scheme="http://www.blogger.com/atom/ns#" term="programacion"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Jueguito</title><content type='html'>El otro día, me prestaron un blackberry que tenia un jueguito que me gusto, asi que hice una versión, para la consola, del juego, he aquí el código:&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;random&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;os&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Square&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;sd&quot;&gt;&quot;&quot;&quot;This is the abstraction of one Square&quot;&quot;&quot;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;__init__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;attrib&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;attrib&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;attrib&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;root&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;root&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rep&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;attrib&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Screen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;sd&quot;&gt;&quot;&quot;&quot;The Screen Array of the game&quot;&quot;&quot;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;__init__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x_size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y_size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tokens&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x_size&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x_size&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y_size&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y_size&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tokens&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tokens&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;childs&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;squares&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;populate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;childs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;squares&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;][&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;childs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rep&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;#&#39;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;get_near_to&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;n&quot;&gt;vecinos&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;br /&gt;            &lt;span class=&quot;n&quot;&gt;vecinos&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get_square&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;br /&gt;            &lt;span class=&quot;n&quot;&gt;vecinos&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get_square&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x_size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;br /&gt;            &lt;span class=&quot;n&quot;&gt;vecinos&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get_square&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y_size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;br /&gt;            &lt;span class=&quot;n&quot;&gt;vecinos&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get_square&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;br /&gt;        &lt;br /&gt;        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;vecino&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;vecino&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;vecinos&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ow&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;vecino&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;childs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;get_square&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;squares&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;][&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;populate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;xrange&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y_size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;&lt;br /&gt;            &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;squares&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;random_square&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;xrange&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x_size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)])&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;random_square&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;&lt;br /&gt;        &lt;br /&gt;        &lt;span class=&quot;n&quot;&gt;attrib&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;random&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;choice&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tokens&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;n&quot;&gt;square&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Square&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;attrib&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;br /&gt;        &lt;br /&gt;        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;square&lt;/span&gt;&lt;br /&gt;    &lt;br /&gt;    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;check_arround&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;sd&quot;&gt;&quot;&quot;&quot;We check the attrib of the near squares&quot;&quot;&quot;&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;n&quot;&gt;vecinos&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get_near_to&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;vecinos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;br /&gt;            &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;vecino&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;vecinos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;br /&gt;                &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;vecino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;attrib&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;attrib&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;&lt;br /&gt;                    &lt;span class=&quot;n&quot;&gt;vecino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rep&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;#&#39;&lt;/span&gt;&lt;br /&gt;                    &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;childs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;vecino&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;__repr__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;n&quot;&gt;output&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;squares&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;br /&gt;            &lt;span class=&quot;n&quot;&gt;output&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%s&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rep&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;&lt;br /&gt;            &lt;span class=&quot;n&quot;&gt;output&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;output&lt;/span&gt;&lt;br /&gt;    &lt;br /&gt;    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;attrib&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;child&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;childs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;br /&gt;            &lt;span class=&quot;n&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;attrib&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;attrib&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;br /&gt;            &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;check_arround&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;__name__&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;__main__&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;n&quot;&gt;screen&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Screen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;1&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;2&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;3&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;4&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;5&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;screen&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;n&quot;&gt;screen&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;screen&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;childs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;attrib&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;#dirty Hack&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;n&quot;&gt;limit&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;18&lt;/span&gt; &lt;br /&gt;    &lt;span class=&quot;n&quot;&gt;win&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;False&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;xrange&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;limit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;raw_input&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;_ &#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;n&quot;&gt;screen&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;n&quot;&gt;os&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;system&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;clear&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;screen&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%4d&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; moves of &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%4d&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;limit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;screen&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;childs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;screen&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x_size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;screen&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y_size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;br /&gt;            &lt;span class=&quot;n&quot;&gt;win&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;br /&gt;            &lt;span class=&quot;k&quot;&gt;break&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;win&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;You Win&quot;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;You loose&quot;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a rel=&quot;license&quot; href=&quot;http://creativecommons.org/licenses/by-nc-sa/2.5/ar/&quot;&gt;Contenido bajo licencia Creative Commons by-nc-sa&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.joaclandia.com.ar/feeds/78659823185813234/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5309403273623549307&amp;postID=78659823185813234' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/78659823185813234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/78659823185813234'/><link rel='alternate' type='text/html' href='http://www.joaclandia.com.ar/2010/07/jueguito.html' title='Jueguito'/><author><name>Joac</name><uri>http://www.blogger.com/profile/02027757346242312656</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5309403273623549307.post-7401691819613153586</id><published>2009-12-01T17:03:00.007-03:00</published><updated>2010-06-04T13:13:49.893-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="gcoop"/><category scheme="http://www.blogger.com/atom/ns#" term="programacion"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Mandando el contenido de un directorio como archivos adjuntos</title><content type='html'>Hoy necesitaba mandar un archivo dividido en 18 partes de 400kB, debido a las limitaciones del proveedor de correo de un colega cubano. La opción de hacerlo a mano es realmente engorrosa, asi que con la ayuda de la documentación de python me mande este script:&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush:python&quot;&gt;import smtplib&lt;br /&gt;import os&lt;br /&gt;from email.mime.text import MIMEText&lt;br /&gt;from email.mime.base import MIMEBase&lt;br /&gt;from email.mime.multipart import MIMEMultipart&lt;br /&gt;from email import encoders&lt;br /&gt;import getpass&lt;br /&gt;directorio = &#39;Directorio de donde Sacamos los Archivos&#39;&lt;br /&gt;asunto = &#39;Aca va el asunto&#39;&lt;br /&gt;destinatarios = [&#39;complete aqui con sus destinatarios&#39;,]&lt;br /&gt;sender = &#39;Aca va Nuestra Direccion&#39;&lt;br /&gt;contenido = &#39;Texto que queremos que se lea en los mensajes&#39;&lt;br /&gt;host = &#39;servidor SMTP que vamos a usar&#39;&lt;br /&gt;login = &#39;nuestro usuario&#39;&lt;br /&gt;#creamos el contenedor&lt;br /&gt;listademails = []&lt;br /&gt;numeroParte = 1&lt;br /&gt;listadoArchivos = os.listdir(directorio)&lt;br /&gt;listadoArchivos.sort()&lt;br /&gt;for archivo in listadoArchivos:&lt;br /&gt;    path = os.path.join(directorio, archivo)&lt;br /&gt;    msg = MIMEMultipart()&lt;br /&gt;    msg[&#39;Subject&#39;] = asunto + &#39; %d de %d&#39; % (numeroParte, len(listadoArchivos)))&lt;br /&gt;    numeroParte += 1&lt;br /&gt;    msg[&#39;From&#39;]= sender&lt;br /&gt;    msg[&#39;To&#39;]=&#39;, &#39;.join(destinatarios)&lt;br /&gt;    #msg.preamble = &#39;&#39;&lt;br /&gt;    texto = MIMEText(contenido, &#39;plain&#39;)&lt;br /&gt;    msg.attach(texto)&lt;br /&gt;    #Adjuntamos el Archivo&lt;br /&gt;    fp = open(path, &#39;rb&#39;)&lt;br /&gt;    adjunto = MIMEBase(&#39;application&#39;, &#39;octet-stream&#39;)&lt;br /&gt;    adjunto.set_payload(fp.read())&lt;br /&gt;    fp.close()&lt;br /&gt;    encoders.encode_base64(adjunto)&lt;br /&gt;    adjunto.add_header(&#39;Content-Disposition&#39;, &#39;attachment&#39;, filename = archivo)&lt;br /&gt;    msg.attach(adjunto)&lt;br /&gt;    listademails.append(msg.as_string())&lt;br /&gt;&lt;br /&gt;server = smtplib.SMTP(host)&lt;br /&gt;server.login(login, getpass.getpass())&lt;br /&gt;for mail in listademails:&lt;br /&gt;    server.sendmail(sender, destinatarios, mail)&lt;br /&gt;server.quit()&lt;br /&gt;&lt;/pre&gt;Dejo en el lector las criticas pertinentes a esta &#39;Belleza&#39;(ironicmode =True) que sorprende por su extrema pythonicidad :P&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a rel=&quot;license&quot; href=&quot;http://creativecommons.org/licenses/by-nc-sa/2.5/ar/&quot;&gt;Contenido bajo licencia Creative Commons by-nc-sa&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.joaclandia.com.ar/feeds/7401691819613153586/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5309403273623549307&amp;postID=7401691819613153586' title='1 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/7401691819613153586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/7401691819613153586'/><link rel='alternate' type='text/html' href='http://www.joaclandia.com.ar/2009/12/mandando-el-contenido-de-un-directorio.html' title='Mandando el contenido de un directorio como archivos adjuntos'/><author><name>Joac</name><uri>http://www.blogger.com/profile/02027757346242312656</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5309403273623549307.post-5066366883193644427</id><published>2009-09-04T21:06:00.008-03:00</published><updated>2009-09-11T16:42:32.916-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="pyconar2009"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Pycon Argentina 2009 - Dia  &#39;-1&#39; (Jueves 3 de septiembre)</title><content type='html'>&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;14:00hs - Universidad de Belgrano.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Estamos citados, junto a la gente de &lt;a href=&quot;http://www.buenosaireslibre.org.ar/&quot;&gt;BAL&lt;/a&gt; para planificar la instalación de la cobertura de internet wifi de la &lt;a href=&quot;http://ar.pycon.org/&quot;&gt;PyCon&lt;/a&gt;. Inicialmente nos juntamos con &lt;a href=&quot;http://www.taniquetil.com.ar/plog/&quot;&gt;Facundo Batista&lt;/a&gt;, coordinador general del evento, para descargar los programas, tutoriales, anotadores y aguas para oradores (unos cientos de kilos de papel y agua). Yo, para ahorrar tiempo relevo unas interesantes rosetas de red, categoría 6 (un lujo). Nuestro contacto de referencia nos dio una explicación muy confusa de que bocas y cables podíamos usar y que no, de paso nos cuenta que en lugar de una conexión ADSL de Telecom, vamos a tener un servicio corporativo de Fibertel, de 5Mb de Download(640kb/s), y unos pobres 512Kb (64kb/s) de Upload. Hasta este punto parece que todo viene viento en popa.&lt;br /&gt;Tuvimos que contratar nuestro propio enlace de internet, porque, según nos cuentan, la gente de sistemas de la &lt;a href=&quot;http://www.ub.edu.ar/&quot;&gt;UB&lt;/a&gt; es bastante vaga, y tienen miedo de que les sobrecarguemos el enlace, y que los hackers que vienen a la convención les vulneren todo.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;16:00hs - Universidad de Belgrano - El horizonte se desdibuja&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Nos dicen que no vamos a poder usar los cables que estan tan bien ubicados en las salas, y que busquemos los cables que habían puesto para las jornadas regionales. Lamentablemente, los usaron para pasar los nuevos, hermosos y relumbrantes cables de categoria 6. En este momento solo teníamos un cable desde el lugar donde luego pondrían Fibertel hasta el subsuelo, donde estarían los stand de los sponsors y de la comunidad. Eso dejaba sin cobertura a los auditorios, desde donde nuestro ansioso publico querria twitear, actualizar sus blogs y navegar sin parar.&lt;br /&gt;Estabamos en un estado de desconcierto, que se convirtió en general cuando los instaladores de Fibertel nos plantearon un panorama desconcertante: no había un cable desde el centro de la manzana (donde estan las pacheras de fibertel) y el cuartito donde tenian que poner el router.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;17:00hs - Universidad de Belgrano - Vemos Tierra a la distancia.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Los muchachos lograron conectar Fibertel, ahora teníamos internet, pero no teníamos como llegar a  cada uno de los accespoint de &lt;a href=&quot;http://www.buenosaireslibre.org.ar/&quot;&gt;BAL&lt;/a&gt;. Entonces se me enciende un chispazo de inteligencia y planee un plan de emergencia:&lt;br /&gt;Las bocas están conectadas a un switch, que entrega direcciones por DHCP, pero en el fondo, no es mas que eso: un switch. ¿¿¿ Porque no nos conectamos por las bocas, de forma, semi ilegal,  y creamos rutas estáticas entre los acces point y el router que va a natear la conexión de Fibertel, dejando que los accespoint nateen y hagan DHCP??, usamos nuestro enlace de Internet, y la red de la &lt;a href=&quot;http://www.ub.edu.ar/&quot;&gt;UB&lt;/a&gt; no peligra.&lt;br /&gt;Cuando le plantee esto al contacto de la &lt;a href=&quot;http://www.ub.edu.ar/&quot;&gt;UB&lt;/a&gt; se horrorizo. Ellos no tenia forma de monitorizar que no lo hiciéramos. Me pidió que esperemos,  que iba a tratar de gestionarnos la llave para que usemos la pachera, y no pasemos por su switch. Con los chicos de &lt;a href=&quot;http://www.buenosaireslibre.org.ar/&quot;&gt;BAL&lt;/a&gt; decidimos que para pasar el rato podíamos ir configurando los equipos wireless. Al caos general se sumo que no teníamos un router, ya que diegui (A.K.A.  dmascialino) había prestado su linksys wrt54g, pero yo no había llegado a pasar a buscarlo.&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;br /&gt;19:00hs - Universidad de Belgrano - Hackeando los sistemas de la &lt;a href=&quot;http://www.ub.edu.ar/&quot;&gt;UB&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Finalmente nos autorizaron a usar la pachera, pero, detalle, me trajeron una llave como la de la puerta de mi casa, que obviamente no era la que necesitábamos (Entiéndase que es un gabinete para montar unidades de rack, con un pequeño agujero por debajo, donde acometen los cables, y una puerta de vidrio, muy paqueta con cerradura tipo candado). A esta altura ya me estaba por explotar el cuerpo en mil pedazos, pero me arme de valor y le dije que si no lo habría, yo rompería la cerradura, sin ninguna culpa. Él me autorizo, así que me puse en acción. Busque mis destornilladores, y opte, como primera opción en usar la fuerza bruta. Todos sabemos que el hacking por fuerza bruta no es demasiado eficiente, así que después de varios intentos, decidí buscar algún bug en la configuración de la caja, para desactivar la protección desde adentro.&lt;br /&gt;Por suerte ese bug existia, y logre llegar con mi mano, atravez del agujero de acometida de cables, sorteando el haz de cables y el enlace de fibra optica (super paquete) hasta la parte trasera de la cerradura, donde comprobé, con mayor fortuna, que había un tornillo.&lt;br /&gt;Entonces con valentia, y rezando porque nadie de seguridad me viera, meti un destornillador y vulnere la maldita cerradura. A los 5 minutos llegaron con otra persona de sistemas, con otro destornillador. Por suerte el trabajo ya estaba hecho ¡y algo mejor!, la cerradura quedo desactivada para futuras convenciones.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;19:00hs Universidad de Belgrano - Esperando la Carroza.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Despues de configurar junto a gacq (de &lt;a href=&quot;http://www.buenosaireslibre.org.ar/&quot;&gt;BAL&lt;/a&gt;) los access point, (unos aparatos muy lindos &lt;a href=&quot;http://www.ubnt.com/products/bullet.php&quot;&gt;que pueden ver aca&lt;/a&gt;)  nos quedamos esperando que peter (tambien de BAL) cayera con el linksys WRT54GL, con &lt;a href=&quot;http://www.dd-wrt.com/dd-wrtv3/index.php&quot;&gt;dd-wrt&lt;/a&gt;, que se encargaría del routeo. Por suerte todo funcionó correctamente, pero nos enteramos de algo muy gracioso: 2 horas antes, los muchachos de Fibertel, dejaron sin televisión a toda la &lt;a href=&quot;http://www.ub.edu.ar/&quot;&gt;UB&lt;/a&gt; (¿¿quién necesita tele en una universidad??)&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;br /&gt;21:00hs Casa&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Estoy reventado, me voy a dormir sin saber lo que me espera mañana.....&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a rel=&quot;license&quot; href=&quot;http://creativecommons.org/licenses/by-nc-sa/2.5/ar/&quot;&gt;Contenido bajo licencia Creative Commons by-nc-sa&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.joaclandia.com.ar/feeds/5066366883193644427/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5309403273623549307&amp;postID=5066366883193644427' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/5066366883193644427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/5066366883193644427'/><link rel='alternate' type='text/html' href='http://www.joaclandia.com.ar/2009/09/pycon-argentina-2009-dia-1-jueves-3-de.html' title='Pycon Argentina 2009 - Dia  &#39;-1&#39; (Jueves 3 de septiembre)'/><author><name>Joac</name><uri>http://www.blogger.com/profile/02027757346242312656</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5309403273623549307.post-3496881414674429374</id><published>2009-08-28T18:34:00.009-03:00</published><updated>2009-09-04T22:44:12.370-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="blogger"/><category scheme="http://www.blogger.com/atom/ns#" term="programacion"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Agregando coloreado de sintaxis en blogspot</title><content type='html'>Luego de escribir el post anterior me encontré con la necesidad de agregar coloreado de sintaxis y números de linea al código fuente Python.&lt;br /&gt;Probe varias posibilidades como &lt;a href=&quot;http://www.simplebits.com/cgi-bin/simplecode.pl?mode=process&quot;&gt;simplecode&lt;/a&gt; (es para codigo html, y no pone numeros de linea) pero ninguno me maravillo. En el canal de Chat de &lt;a href=&quot;http://www.blogger.com/post-create.g?blogID=5309403273623549307&quot;&gt; PyAr&lt;/a&gt; (#pyar en freenode) me pasaron el link a un &lt;a href=&quot;http://www.webresourcesdepot.com/11-syntax-highlighters-to-beautify-code-presentation/&quot;&gt;post en webresourcesdepot.com&lt;/a&gt; donde sugiere 11 opciones para resaltar la sintaxis. La primera opcion es usar Geshi (el que usan en wikipedia) pero no es facil de integrar en blogger.&lt;br /&gt;&lt;br /&gt;La segunda opcion es &lt;a target=&quot;_blank&quot; href=&quot;http://alexgorbatchev.com/wiki/SyntaxHighlighter&quot;&gt;SyntaxHighlighter&lt;/a&gt;, desarrollado en javascript por &lt;a href=&quot;http://alexgorbatchev.com/&quot;&gt;Alex Gorbatchev. &lt;/a&gt;&lt;br /&gt;Su integracion en blogger es muy sencilla y la explicare a continuación:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Nos logeamos en nuestra cuenta de blogspot y vamos, dentro de la pestaña &quot;Diseño&quot; a la opción &quot;Edicion HTML&quot;. El documento en cuestion es el &quot;esqueleto&quot; de nuestro blog.&lt;/li&gt;&lt;li&gt;Lo recomendable en este paso es guardar la plantilla en nuestra pc, para tener un backup, en caso de cometamos algun error en la edición&lt;/li&gt;&lt;li&gt;Buscamos la etiqueta &amp;lt/head&amp;gt y a continacion pegamos lo siguiente&lt;/li&gt;&lt;br /&gt;&lt;pre class=&quot;brush:html&quot;&gt;&lt;br /&gt;&amp;lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shCore.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&amp;gt;&lt;br /&gt;&amp;lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&amp;gt;&lt;br /&gt;&amp;lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;!-- add brushes here --&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;script type=&quot;&#39;text/javascript&#39;&quot;&amp;gt;&amp;lt;br /&amp;gt;  SyntaxHighlighter.config.bloggerMode = true;&amp;lt;br /&amp;gt;  SyntaxHighlighter.all();&amp;lt;br /&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Despues del comentario donde dice &quot;add brushes here&quot; pegamos las llamadas a los lenguajes que queremos tener habilitados para colorear (conviene poner los menos posibles, para no ralentizar la carga de las paginas)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;pre class=&quot;brush:html&quot;&gt;&lt;br /&gt;&amp;lt;!--Colorea AS3--&amp;gt;&lt;br /&gt;&amp;lt;script src=&#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushAS3.js&#39; type=&#39;text/javascript&#39;/&amp;gt;&lt;br /&gt;&amp;lt;!--Colorea Bash--&amp;gt;&lt;br /&gt;&amp;lt;script src=&#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js&#39; type=&#39;text/javascript&#39;/&amp;gt;&lt;br /&gt;&amp;lt;!--Colorea CSharp--&amp;gt;&lt;br /&gt;&amp;lt;script src=&#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js&#39; type=&#39;text/javascript&#39;/&amp;gt;&lt;br /&gt;&amp;lt;!--Colorea Cpp--&amp;gt;&lt;br /&gt;&amp;lt;script src=&#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js&#39; type=&#39;text/javascript&#39;/&amp;gt;&lt;br /&gt;&amp;lt;!--Colorea Css--&amp;gt;&lt;br /&gt;&amp;lt;script src=&#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js&#39; type=&#39;text/javascript&#39;/&amp;gt;&lt;br /&gt;&amp;lt;!--Colorea Delphi--&amp;gt;&lt;br /&gt;&amp;lt;script src=&#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushDelphi.js&#39; type=&#39;text/javascript&#39;/&amp;gt;&lt;br /&gt;&amp;lt;!--Colorea Diff--&amp;gt;&lt;br /&gt;&amp;lt;script src=&#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushDiff.js&#39; type=&#39;text/javascript&#39;/&amp;gt;&lt;br /&gt;&amp;lt;!--Colorea Groovy--&amp;gt;&lt;br /&gt;&amp;lt;script src=&#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushGroovy.js&#39; type=&#39;text/javascript&#39;/&amp;gt;&lt;br /&gt;&amp;lt;!--Colorea JScript--&amp;gt;&lt;br /&gt;&amp;lt;script src=&#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js&#39; type=&#39;text/javascript&#39;/&amp;gt;&lt;br /&gt;&amp;lt;!--Colorea Java--&amp;gt;&lt;br /&gt;&amp;lt;script src=&#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js&#39; type=&#39;text/javascript&#39;/&amp;gt;&lt;br /&gt;&amp;lt;!--Colorea JavaFX--&amp;gt;&lt;br /&gt;&amp;lt;script src=&#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJavaFX.js&#39; type=&#39;text/javascript&#39;/&amp;gt;&lt;br /&gt;&amp;lt;!--Colorea Perl--&amp;gt;&lt;br /&gt;&amp;lt;script src=&#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js&#39; type=&#39;text/javascript&#39;/&amp;gt;&lt;br /&gt;&amp;lt;!--Colorea Php--&amp;gt;&lt;br /&gt;&amp;lt;script src=&#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js&#39; type=&#39;text/javascript&#39;/&amp;gt;&lt;br /&gt;&amp;lt;!--Colorea Plain--&amp;gt;&lt;br /&gt;&amp;lt;script src=&#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPlain.js&#39; type=&#39;text/javascript&#39;/&amp;gt;&lt;br /&gt;&amp;lt;!--Colorea PowerShell--&amp;gt;&lt;br /&gt;&amp;lt;script src=&#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPowerShell.js&#39; type=&#39;text/javascript&#39;/&amp;gt;&lt;br /&gt;&amp;lt;!--Colorea Python--&amp;gt;&lt;br /&gt;&amp;lt;script src=&#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js&#39; type=&#39;text/javascript&#39;/&amp;gt;&lt;br /&gt;&amp;lt;!--Colorea Ruby--&amp;gt;&lt;br /&gt;&amp;lt;script src=&#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js&#39; type=&#39;text/javascript&#39;/&amp;gt;&lt;br /&gt;&amp;lt;!--Colorea Scala--&amp;gt;&lt;br /&gt;&amp;lt;script src=&#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushScala.js&#39; type=&#39;text/javascript&#39;/&amp;gt;&lt;br /&gt;&amp;lt;!--Colorea Sql--&amp;gt;&lt;br /&gt;&amp;lt;script src=&#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js&#39; type=&#39;text/javascript&#39;/&amp;gt;&lt;br /&gt;&amp;lt;!--Colorea Vb--&amp;gt;&lt;br /&gt;&amp;lt;script src=&#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js&#39; type=&#39;text/javascript&#39;/&amp;gt;&lt;br /&gt;&amp;lt;!--Colorea Xml--&amp;gt;&lt;br /&gt;&amp;lt;script src=&#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js&#39; type=&#39;text/javascript&#39;/&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Para utilizarlo usamos:&lt;br /&gt;&lt;pre class=&quot;brush:html&quot;&gt;&lt;br /&gt;&amp;lt;pre class=&quot;brush:lenguaje&quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;Ponemos nuestro codigo aqui&lt;br /&gt;&lt;br /&gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Donde &quot;lenguaje&quot; es el alias del lenguaje que estamos usando &lt;a href=&quot;http://alexgorbatchev.com/wiki/SyntaxHighlighter:Brushes&quot;&gt;aqui esta la lista completa de alias&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Nota: si queremos pegar codigo html hay que codificarlo primero con &lt;a href=&quot;http://www.simplebits.com/cgi-bin/simplecode.pl?mode=process&quot;&gt;simplecode&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a rel=&quot;license&quot; href=&quot;http://creativecommons.org/licenses/by-nc-sa/2.5/ar/&quot;&gt;Contenido bajo licencia Creative Commons by-nc-sa&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.joaclandia.com.ar/feeds/3496881414674429374/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5309403273623549307&amp;postID=3496881414674429374' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/3496881414674429374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/3496881414674429374'/><link rel='alternate' type='text/html' href='http://www.joaclandia.com.ar/2009/08/agregando-coloreado-de-sintaxis-en.html' title='Agregando coloreado de sintaxis en blogspot'/><author><name>Joac</name><uri>http://www.blogger.com/profile/02027757346242312656</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5309403273623549307.post-2727927720384470710</id><published>2009-08-20T21:34:00.012-03:00</published><updated>2009-08-27T20:58:02.460-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Buscando con Google desde Python (2.6) Parte 1</title><content type='html'>Empezé a investigar, para un nuevo proyecto, como utilizar la &lt;a href=&quot;http://code.google.com/intl/es-AR/apis/ajaxsearch/&quot; target=&quot;_blank&quot;&gt;API AJAX de Google para Busquedas&lt;/a&gt; en conjunto con &lt;a href=&quot;http://www.python.org/&quot; target=&quot;_blank&quot;&gt;Python&lt;/a&gt;, lenguaje que se encargara del procesamiento en el lado del servidor y generara la pagina con los resultados.&lt;br /&gt;&lt;br /&gt;Me encontré con el blog de &lt;a href=&quot;http://dcortesi.com/2008/05/28/google-ajax-search-api-example-python-code/&quot; target=&quot;_blank&quot;&gt;Damon Cortesi&lt;/a&gt; que contiene un ejemplo de uso, que utiliza &lt;a href=&quot;http://code.google.com/p/simplejson/&quot;&gt;simplejson&lt;/a&gt;, incorporado en la biblioteca estandar a partir de Python 2.6.&lt;br /&gt;&lt;br /&gt;Nuestro uso del api se limita a construir un URL que incluya los terminos a buscar y las restricciones de la misma.&lt;br /&gt;La URL base es &lt;a target=&quot;_blank&quot; href=&quot;http://ajax.googleapis.com/ajax/services/search/images?v=1.0&amp;amp;q=Google&quot;&gt;http://ajax.googleapis.com/ajax/services/search/images&lt;/a&gt; , a la que tendremos que agregar el termino a buscar, la version del protocolo, la cantidad de resultados devueltos&lt;br /&gt;&lt;pre class=&quot;brush:python&quot;&gt;&lt;br /&gt;# -*- coding: utf-8 -*-&lt;br /&gt;#!/usr/bin/python&lt;br /&gt;&lt;br /&gt;import urllib&lt;br /&gt;import json&lt;br /&gt;# vamos a crear la consulta&lt;br /&gt;query = urllib.urlencode({&#39;q&#39;   : &#39;flores&#39;,   #cadena a buscar&lt;br /&gt;                          &#39;v&#39;   : &#39;1.0&#39;,      #version del protocolo&lt;br /&gt;                          &#39;rsz&#39; : &#39;large&#39;})   # estableces que se devuelvan 8 resultados por consulta&lt;br /&gt;#completamos el url&lt;br /&gt;url = &#39;http://ajax.googleapis.com/ajax/services/search/images?%s&#39; \&lt;br /&gt;  % (query)&lt;br /&gt;#solicitamos el url&lt;br /&gt;resultados = urllib.urlopen(url).read()&lt;br /&gt;#interpretamos el objeto json. json.loads() nos devuelve un diccionario&lt;br /&gt;json = json.loads(resultados)&lt;br /&gt;#creamos un diccionario con los datos que nos interesan&lt;br /&gt;resultados = json[&#39;responseData&#39;][&#39;results&#39;]&lt;br /&gt;#los  imprimimos!&lt;br /&gt;for i in resultados:&lt;br /&gt;  print i[&#39;title&#39;] + &quot;: &quot; + i[&#39;url&#39;]&lt;br /&gt;  &lt;br /&gt;&quot;&quot;&quot;Salida:&lt;br /&gt;flores089.gif: http://i121.photobucket.com/albums/o207/bicfomh/rec/flores/flores089.gif&lt;br /&gt;ashley-flores.jpg: http://www.hoax-slayer.com/images/ashley-flores.jpg&lt;br /&gt;z-flores.gif: http://www.zwani.com/graphics/portuguese/flores/images/z-flores.gif&lt;br /&gt;Flor_289035504_017_flores.jpg: http://images.recados.net/img/recados/Flor_289035504_017_flores.jpg&lt;br /&gt;z-flores1.gif: http://images.zwani.com/graphics/portuguese/flores/images/z-flores1.gif&lt;br /&gt;z-flores3.gif: http://www.zwani.com/graphics/portuguese/flores/images/z-flores3.gif&lt;br /&gt;z-flores10.gif: http://www.recados.com/graficos/flores/images/z-flores10.gif&lt;br /&gt;RanchodeLasFlores3.jpg: http://www.herecomestheguide.com/images/location/RanchodeLasFlores/RanchodeLasFlores3.jpg&lt;br /&gt;&quot;&quot;&quot;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Durante esta semana voy a seguir investigando, y voy a pasar de urllib a urllib2, que es mas eficiente(segun lo que lei)&lt;br /&gt;&lt;br /&gt;Si quieren saber mas sobre la api AJAX lo pueden encontrar en:&lt;br /&gt;&lt;a href=&quot;http://code.google.com/intl/es/apis/ajaxsearch/documentation/reference.html#_intro_fonje&quot;&gt;http://code.google.com/intl/es/apis/ajaxsearch/documentation/reference.html#_intro_fonje&lt;/a&gt;&lt;br /&gt;Hasta la proxima!&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a rel=&quot;license&quot; href=&quot;http://creativecommons.org/licenses/by-nc-sa/2.5/ar/&quot;&gt;Contenido bajo licencia Creative Commons by-nc-sa&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.joaclandia.com.ar/feeds/2727927720384470710/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5309403273623549307&amp;postID=2727927720384470710' title='1 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/2727927720384470710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/2727927720384470710'/><link rel='alternate' type='text/html' href='http://www.joaclandia.com.ar/2009/08/buscando-con-google-desde-python-26.html' title='Buscando con Google desde Python (2.6) Parte 1'/><author><name>Joac</name><uri>http://www.blogger.com/profile/02027757346242312656</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5309403273623549307.post-1473216385168938634</id><published>2009-05-04T14:48:00.003-03:00</published><updated>2009-05-04T15:17:45.754-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="OPC"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Instalando Open OPC en Python 2.6</title><content type='html'>Despues de volverme loco con dos interpretes de python instalados (el 2.5 y el 2.6) decidi desinstalar el mas viejo, que solo tenia para poder usar la aplicación &lt;a href=&quot;http://openopc.sourceforge.net/&quot;&gt;OpenOPC&lt;/a&gt;[1].&lt;br /&gt;&lt;br /&gt;No fue muy complicado migrarla. Los Pasos estan Abajo&lt;br /&gt;-Instalar &lt;a href=&quot;http://sourceforge.net/projects/pyro/&quot;&gt;Pyro&lt;/a&gt;[2]&lt;br /&gt;-Instalar &lt;a href=&quot;http://sourceforge.net/projects/pywin32/&quot;&gt;PyWin&lt;/a&gt;[3]&lt;br /&gt;-Instalar &lt;a href=&quot;http://sourceforge.net/project/showfiles.php?group_id=199423&amp;amp;package_id=236604&quot;&gt;OpenOPC&lt;/a&gt;&lt;br /&gt;Va a decirnos que no puede instalar las librerias de desarrollo porque no encuentra el python.&lt;br /&gt;Le damos ok y seguimos el proceso.&lt;br /&gt;Cuando Termina vamos a la carpeta donde esta instalado el OpenOPC (Por Defecto esta en C:\OpenOPC) luego a &quot;\src&quot; y copiamos los cuatro archivos a la carpeta &#39;\Lib\site-packages&#39; de nuestro Python 2.6(Por defecto es C:\Python26\Lib\site-packages)&lt;br /&gt;Y voala!!&lt;br /&gt;ya funciona....&lt;br /&gt;&lt;br /&gt;Igualmente le escribi un correo al mantenedor, para que lo upgradiemos!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[1]OpenOPC for Python is a free, open source OPC (OLE for Process Control)&lt;br /&gt;[2]Python Extensions for Windows&lt;br /&gt;[3]Python Remote Objects&lt;br /&gt;&lt;h1&gt;&lt;a href=&quot;http://sourceforge.net/projects/pyro/&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;/h1&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a rel=&quot;license&quot; href=&quot;http://creativecommons.org/licenses/by-nc-sa/2.5/ar/&quot;&gt;Contenido bajo licencia Creative Commons by-nc-sa&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.joaclandia.com.ar/feeds/1473216385168938634/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5309403273623549307&amp;postID=1473216385168938634' title='2 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/1473216385168938634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/1473216385168938634'/><link rel='alternate' type='text/html' href='http://www.joaclandia.com.ar/2009/05/instalando-open-opc-en-python-26.html' title='Instalando Open OPC en Python 2.6'/><author><name>Joac</name><uri>http://www.blogger.com/profile/02027757346242312656</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5309403273623549307.post-6968293285526106508</id><published>2009-04-27T08:40:00.011-03:00</published><updated>2009-04-27T15:09:33.550-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="micros"/><category scheme="http://www.blogger.com/atom/ns#" term="proyectos"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Cambios en el Blog</title><content type='html'>Bienvenidos lectores casuales de este Blog.&lt;br /&gt;Mediante este comunicado extraordinario les informo que el perfil pseudopoetico de este blog será modificado abruptamente, para convertirse en un blog dedicado a proyectos relacionados con microcontroladores, python, linux, matematicas, fisica y alguna que otra receta de cocina.&lt;br /&gt;&lt;br /&gt;Cualquier sugerencia o pedido pueden realizarlo a traves de los comentarios.&lt;br /&gt;&lt;br /&gt;Como Topico para abrir esta nueva etapa voy a esbozar un proyecto proximo a ser comenzado:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; font-style: italic;&quot;&gt;El &quot;Brazo Modelador 3D&quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Consiste de un brazo articulado en dos puntos, con 6 grados de libertad en total, que va a permitir tomar coordenadas tridimensionales, para luego procesarlas en blender (preferentemente).&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Su aplicación es principalmente para artistas 3D que quieran tener una forma sencilla y DIY[1] de construirse un escaner 3d&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; font-style: italic;&quot;&gt;Materiales a Utilizar:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;- 6 Encoders de mouse de bola (se necesitan 3 mouses completos)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;- 1 Microcontrolador y su periferia (La interfaz deberia ser preferentemente USB)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;- Imaginación y material espacial[2] (Cantidad Suficiente)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; font-style: italic;&quot;&gt;Implementación del driver:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;La idea es usar algo como pyserial[3] pero USB para poder comunicarse con el microprocesador. EL formato del mensaje del micro seria &quot;E,x,y,z&quot;&lt;e&gt;&lt;x&gt;&lt;y&gt;&lt;z&gt; &lt;e&gt;&lt;x&gt;&lt;y&gt;&lt;z&gt;&lt;e&gt;&lt;x&gt;&lt;y&gt;&lt;z&gt; donde E seria el estado del micro (cosas como &#39;Iniciando&#39;, &#39;Esperando Punto&#39;, &#39;Lectura OK&#39; etc...) y &#39;x&#39;, &#39;y&#39;, &#39;z&#39; son las coordenadas del punto tomado. El driver Devuelve una Repetición de los datos leídos, si son iguales se pone la salida a 0 y sigue, sino, reenvía los datos. Después se formatea para poder abrirlo con Blender[4] ( Debo buscar la documentación)&lt;/z&gt;&lt;/y&gt;&lt;/x&gt;&lt;/e&gt;&lt;/z&gt;&lt;/y&gt;&lt;/x&gt;&lt;/e&gt;&lt;/z&gt;&lt;/y&gt;&lt;/x&gt;&lt;/e&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Como funciones adicionales se puede mover la ubicación del origen de coordenadas para superficies complejas.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; font-style: italic;&quot;&gt;TO DO:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;-Buscar documentación de el hardware a  utilizar.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;-Diseño mecánico preciso del dispositivo.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;-Programa del micro.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;-Programa Driver en Python.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;-Documentación de Blender.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;En la próxima entrega un plano esquemático y links a documentación.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Enjoy!&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;--&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Referencias&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;[1]&lt;a href=&quot;http://es.wikipedia.org/wiki/DIY&quot;&gt;http://es.wikipedia.org/wiki/DIY&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;[2]En mi Colegio Industrial la llamabamos asi a todo lo que &quot;Caida del Cielo&quot; lease Chatarra o Similar&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;[3]&lt;a href=&quot;http://pyserial.wiki.sourceforge.net/pySerial&quot;&gt;http://pyserial.wiki.sourceforge.net/pySerial&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;[4]&lt;a href=&quot;http://www.blender.org/&quot;&gt;http://www.blender.org/&lt;/a&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a rel=&quot;license&quot; href=&quot;http://creativecommons.org/licenses/by-nc-sa/2.5/ar/&quot;&gt;Contenido bajo licencia Creative Commons by-nc-sa&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.joaclandia.com.ar/feeds/6968293285526106508/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5309403273623549307&amp;postID=6968293285526106508' title='1 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/6968293285526106508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5309403273623549307/posts/default/6968293285526106508'/><link rel='alternate' type='text/html' href='http://www.joaclandia.com.ar/2009/04/cambios-en-el-blog.html' title='Cambios en el Blog'/><author><name>Joac</name><uri>http://www.blogger.com/profile/02027757346242312656</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>