<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>CODARE &#187; Lauro Cesar</title>
	<atom:link href="http://codare.net/author/olarva/feed/" rel="self" type="application/rss+xml" />
	<link>http://codare.net</link>
	<description>Programadores, uni-vos!</description>
	<lastBuildDate>Tue, 29 Sep 2009 12:00:01 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>pt-br</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='codare.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/d9589f1266f7b80a398397e3165f7c56?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>CODARE &#187; Lauro Cesar</title>
		<link>http://codare.net</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://codare.net/osd.xml" title="CODARE" />
	<atom:link rel='hub' href='http://codare.net/?pushpress=hub'/>
		<item>
		<title>Python: Adicionar argumentos ao método Bind (wxPython)</title>
		<link>http://codare.net/2009/09/29/python-adicionar-argumentos-ao-metodo-bind-wxpython/</link>
		<comments>http://codare.net/2009/09/29/python-adicionar-argumentos-ao-metodo-bind-wxpython/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 12:00:01 +0000</pubDate>
		<dc:creator>Lauro Cesar</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://codare.net/?p=519</guid>
		<description><![CDATA[O método Bind() no wxPython permite associar métodos a eventos. Por exemplo:
Bind(wx.EVT_BUTTON, sys.exit(), id=ID_BUTTON)
Ao clicar, o método exit() é disparado.
Para permitir que o método disparado receba argumentos, podemos utilizar:
botao =  wx.Button(self, -1, "Instalar")

Bind(wx.EVT_BUTTON, lambda event: Metodo(event, 'argumento'), botao)

def Metodo(self, argumento):
    print argumento
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codare.net&blog=417062&post=519&subd=codare&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>O método Bind() no wxPython permite associar métodos a eventos. Por exemplo:</p>
<pre>Bind(wx.EVT_BUTTON, sys.exit(), id=ID_BUTTON)</pre>
<p>Ao clicar, o método exit() é disparado.</p>
<p>Para permitir que o método disparado receba argumentos, podemos utilizar:</p>
<pre>botao =  wx.Button(self, -1, "Instalar")

Bind(wx.EVT_BUTTON, lambda event: Metodo(event, 'argumento'), botao)

def Metodo(self, argumento):
    print argumento</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codare.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codare.wordpress.com/519/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codare.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codare.wordpress.com/519/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codare.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codare.wordpress.com/519/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codare.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codare.wordpress.com/519/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codare.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codare.wordpress.com/519/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codare.net&blog=417062&post=519&subd=codare&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://codare.net/2009/09/29/python-adicionar-argumentos-ao-metodo-bind-wxpython/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3e695c2389b7d5dfae9b15bd39b3379c?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">olarva</media:title>
		</media:content>
	</item>
		<item>
		<title>Python: Introspeção de atributos e métodos com vars(), locals() e dir()</title>
		<link>http://codare.net/2009/09/25/python-introspecao-de-atributos-e-metodos-com-vars-locals-e-dir/</link>
		<comments>http://codare.net/2009/09/25/python-introspecao-de-atributos-e-metodos-com-vars-locals-e-dir/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 12:00:59 +0000</pubDate>
		<dc:creator>Lauro Cesar</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[atributos]]></category>
		<category><![CDATA[locals]]></category>
		<category><![CDATA[vars]]></category>

		<guid isPermaLink="false">http://codare.net/?p=479</guid>
		<description><![CDATA[Para descobrir os atributos de um objeto podemos utilizar:
objeto.__dict__

vars(objeto)
Para descobrir os atributos de uma classe:
vars(Classe())
Se utilizar vars() sem argumentos, funciona como locals(), listando todas as variáveis.
Para listar métodos e atributos de um objeto:
dir(objeto)
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codare.net&blog=417062&post=479&subd=codare&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Para descobrir os atributos de um objeto podemos utilizar:</p>
<pre>objeto.__dict__

vars(objeto)</pre>
<p>Para descobrir os atributos de uma classe:</p>
<pre>vars(Classe())</pre>
<p>Se utilizar vars() sem argumentos, funciona como locals(), listando todas as variáveis.</p>
<p>Para listar métodos e atributos de um objeto:</p>
<pre>dir(objeto)</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codare.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codare.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codare.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codare.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codare.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codare.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codare.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codare.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codare.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codare.wordpress.com/479/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codare.net&blog=417062&post=479&subd=codare&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://codare.net/2009/09/25/python-introspecao-de-atributos-e-metodos-com-vars-locals-e-dir/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3e695c2389b7d5dfae9b15bd39b3379c?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">olarva</media:title>
		</media:content>
	</item>
		<item>
		<title>Tcl/Tk: Configurar o encoding de scripts</title>
		<link>http://codare.net/2008/02/13/tcl-tk-configurar-o-encoding-de-scripts/</link>
		<comments>http://codare.net/2008/02/13/tcl-tk-configurar-o-encoding-de-scripts/#comments</comments>
		<pubDate>Wed, 13 Feb 2008 12:00:15 +0000</pubDate>
		<dc:creator>Lauro Cesar</dc:creator>
				<category><![CDATA[Tcl-Tk]]></category>
		<category><![CDATA[charset]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[iso8859-1]]></category>
		<category><![CDATA[utf-8]]></category>

		<guid isPermaLink="false">http://codare.wordpress.com/?p=179</guid>
		<description><![CDATA[Para determinar qual encoding seu script deve rodar, use na primeira linha:
encoding system [tabela]
Exemplo:
encoding system utf-8
Para listar as tabelas disponíveis:
encoding names
Exemplo de listagem:

foreach i [encoding names] {
    puts "A tabela $i está disponível neste sistema"
}

       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codare.net&blog=417062&post=179&subd=codare&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Para determinar qual encoding seu script deve rodar, use na primeira linha:</p>
<pre>encoding system [tabela]</pre>
<p>Exemplo:</p>
<pre>encoding system utf-8</pre>
<p>Para listar as tabelas disponíveis:</p>
<pre>encoding names</pre>
<p>Exemplo de listagem:</p>
<pre>
foreach i [encoding names] {
    puts "A tabela $i está disponível neste sistema"
}
</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/codare.wordpress.com/179/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/codare.wordpress.com/179/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codare.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codare.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codare.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codare.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codare.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codare.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codare.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codare.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codare.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codare.wordpress.com/179/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codare.net&blog=417062&post=179&subd=codare&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://codare.net/2008/02/13/tcl-tk-configurar-o-encoding-de-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3e695c2389b7d5dfae9b15bd39b3379c?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">olarva</media:title>
		</media:content>
	</item>
		<item>
		<title>Tcl/Tk: Obter chaves e valores de um array set</title>
		<link>http://codare.net/2007/11/07/tcl-tk-obter-chaves-e-valores-de-um-array-set/</link>
		<comments>http://codare.net/2007/11/07/tcl-tk-obter-chaves-e-valores-de-um-array-set/#comments</comments>
		<pubDate>Wed, 07 Nov 2007 12:30:44 +0000</pubDate>
		<dc:creator>Lauro Cesar</dc:creator>
				<category><![CDATA[Tcl-Tk]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[array names]]></category>
		<category><![CDATA[foreach]]></category>
		<category><![CDATA[interar lista]]></category>
		<category><![CDATA[listas]]></category>
		<category><![CDATA[todos os valores de um array]]></category>

		<guid isPermaLink="false">http://codare.net/2007/11/07/tcl-tk-obter-chaves-e-valores-de-um-array-set/</guid>
		<description><![CDATA[Com o comando:

array set minha_var { chave {valor} chave2 {valor2} }

Criamos uma array com diversas chaves e valores. Exemplo:

array set produtos { }
set produtos(nome) { Banana Caturra }

puts $produtos(nome)

# Retorna: Banana Caturra

Para listar todas as chaves e valores utilizamos o comando:

array names produtos

Exemplo de utilização:

foreach key [array names produtos] {
	puts "Chave: $key"
	puts "Valor: $produtos($key)"
}

  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codare.net&blog=417062&post=177&subd=codare&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Com o comando:</p>
<pre>
array set minha_var { chave {valor} chave2 {valor2} }
</pre>
<p>Criamos uma array com diversas chaves e valores. Exemplo:</p>
<pre>
array set produtos { }
set produtos(nome) { Banana Caturra }

puts $produtos(nome)

# Retorna: Banana Caturra
</pre>
<p>Para listar todas as chaves e valores utilizamos o comando:</p>
<pre>
array names produtos
</pre>
<p>Exemplo de utilização:</p>
<pre>
foreach key [array names produtos] {
	puts "Chave: $key"
	puts "Valor: $produtos($key)"
}
</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/codare.wordpress.com/177/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/codare.wordpress.com/177/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codare.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codare.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codare.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codare.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codare.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codare.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codare.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codare.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codare.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codare.wordpress.com/177/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codare.net&blog=417062&post=177&subd=codare&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://codare.net/2007/11/07/tcl-tk-obter-chaves-e-valores-de-um-array-set/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3e695c2389b7d5dfae9b15bd39b3379c?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">olarva</media:title>
		</media:content>
	</item>
		<item>
		<title>Tcl/Tk: Substituir strings</title>
		<link>http://codare.net/2007/10/26/tcl-tk-substituir-strings/</link>
		<comments>http://codare.net/2007/10/26/tcl-tk-substituir-strings/#comments</comments>
		<pubDate>Fri, 26 Oct 2007 12:30:21 +0000</pubDate>
		<dc:creator>Lauro Cesar</dc:creator>
				<category><![CDATA[Tcl-Tk]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[strings]]></category>
		<category><![CDATA[substituir]]></category>

		<guid isPermaLink="false">http://codare.net/2007/10/26/tcl-tk-substituir-strings/</guid>
		<description><![CDATA[Para manipular Strings em Tcl, utilizamos o comando string.
Se precisar substituir ponto por vírgula:

set valor { 10.00 }
puts [string map -nocase { . , }  $valor]

# Retorna: 10,00
Podemos substituir várias cadeias de caracteres:

set texto "Este é um texto de teste de substituição"
puts [string map -nocase { e E s S b B } $texto]

# [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codare.net&blog=417062&post=172&subd=codare&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Para manipular Strings em Tcl, utilizamos o comando string.</p>
<p>Se precisar substituir ponto por vírgula:</p>
<pre>
set valor { 10.00 }
puts [string map -nocase { . , }  $valor]

# Retorna: 10,00</pre>
<p>Podemos substituir várias cadeias de caracteres:</p>
<pre>
set texto "Este é um texto de teste de substituição"
puts [string map -nocase { e E s S b B } $texto]

# Retorna: EStE é um tExto dE tEStE dE SuBStituição</pre>
<p>Naturalmente, podemos substituir palavras:</p>
<pre>
set texto "Este é um texto de teste de substituição"
puts [string map -nocase { teste TESTE um {o segundo} } $texto]

# Retorna: Este é o segundo texto de TESTE de substituição
</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/codare.wordpress.com/172/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/codare.wordpress.com/172/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codare.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codare.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codare.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codare.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codare.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codare.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codare.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codare.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codare.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codare.wordpress.com/172/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codare.net&blog=417062&post=172&subd=codare&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://codare.net/2007/10/26/tcl-tk-substituir-strings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3e695c2389b7d5dfae9b15bd39b3379c?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">olarva</media:title>
		</media:content>
	</item>
		<item>
		<title>Tcl/Tk: Carregando scripts em lote (bibliotecas)</title>
		<link>http://codare.net/2007/10/23/tcl-tk-carregando-scripts-em-lote-bibliotecas/</link>
		<comments>http://codare.net/2007/10/23/tcl-tk-carregando-scripts-em-lote-bibliotecas/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 12:30:05 +0000</pubDate>
		<dc:creator>Lauro Cesar</dc:creator>
				<category><![CDATA[Tcl-Tk]]></category>
		<category><![CDATA[biblioteca]]></category>
		<category><![CDATA[diretórios]]></category>
		<category><![CDATA[glob]]></category>
		<category><![CDATA[path]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://codare.net/2007/10/23/tcl-tk-carregando-scripts-em-lote-bibliotecas/</guid>
		<description><![CDATA[E possível destinar um diretório para nossos códigos auxiliares ou plugins, e na inicialização do sistema importá-los, utilizando o comando source.
Por exemplo, considerando que há vários arquivos .tcl no diretório plugin/

foreach p "[glob plugin/*.tcl]" {
	source $p
}
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codare.net&blog=417062&post=176&subd=codare&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>E possível destinar um diretório para nossos códigos auxiliares ou plugins, e na inicialização do sistema importá-los, utilizando o comando source.</p>
<p>Por exemplo, considerando que há vários arquivos .tcl no diretório plugin/</p>
<pre>
foreach p "[glob plugin/*.tcl]" {
	source $p
}</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/codare.wordpress.com/176/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/codare.wordpress.com/176/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codare.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codare.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codare.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codare.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codare.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codare.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codare.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codare.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codare.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codare.wordpress.com/176/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codare.net&blog=417062&post=176&subd=codare&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://codare.net/2007/10/23/tcl-tk-carregando-scripts-em-lote-bibliotecas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3e695c2389b7d5dfae9b15bd39b3379c?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">olarva</media:title>
		</media:content>
	</item>
		<item>
		<title>Tcl/Tk: Capturando e tratando erros</title>
		<link>http://codare.net/2007/10/17/tcl-tk-capturando-e-tratando-erros/</link>
		<comments>http://codare.net/2007/10/17/tcl-tk-capturando-e-tratando-erros/#comments</comments>
		<pubDate>Wed, 17 Oct 2007 12:30:42 +0000</pubDate>
		<dc:creator>Lauro Cesar</dc:creator>
				<category><![CDATA[Tcl-Tk]]></category>
		<category><![CDATA[capturar]]></category>
		<category><![CDATA[catch]]></category>
		<category><![CDATA[erros]]></category>
		<category><![CDATA[Tcl/Tk]]></category>

		<guid isPermaLink="false">http://codare.net/2007/10/17/tcl-tk-capturando-e-tratando-erros/</guid>
		<description><![CDATA[Palavras-chave: Tcl/Tk, capturar, erros
Quando um procedimento é executando em Tcl, ele retorna 1 (sucesso) ou 0 (falha). É este resultado que faz o interpretador mostrar ou não um erro.
Para não mostrar o erro ao usuário, mas detectá-lo e tratá-lo no código, use o comando catch. Ele chama o interpretador Tcl de forma recursiva, executando o [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codare.net&blog=417062&post=166&subd=codare&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Palavras-chave: Tcl/Tk, capturar, erros</p>
<p>Quando um procedimento é executando em Tcl, ele retorna 1 (sucesso) ou 0 (falha). É este resultado que faz o interpretador mostrar ou não um erro.</p>
<p>Para não mostrar o erro ao usuário, mas detectá-lo e tratá-lo no código, use o comando <strong>catch</strong>. Ele chama o interpretador Tcl de forma recursiva, executando o código e retorna 5 possíveis sinais:</p>
<ul>
<li>0 &#8211; TCL_OK</li>
<li>1 &#8211; TCL_ERROR</li>
<li>2 &#8211; TCL_RETURN</li>
<li>3 &#8211; TCL_BREAK</li>
<li>4 &#8211; TCL_CONTINUE</li>
</ul>
<p>Por exemplo, como saber se a conexão ao banco de dados foi bem sucedida?</p>
<pre>
if { [catch {set token [mysqlconnect \
	-host sqlserver \
	-user user_db \
	-db banco_de_dados \
	-password senha]} err_con] } {
    puts "Erro ao Conectar : $err_con"
}</pre>
<p>Se o comando de conectar obteve sucesso, o catch retorna 0 (zero) ou false, fazendo com que o if não execute.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/codare.wordpress.com/166/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/codare.wordpress.com/166/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codare.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codare.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codare.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codare.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codare.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codare.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codare.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codare.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codare.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codare.wordpress.com/166/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codare.net&blog=417062&post=166&subd=codare&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://codare.net/2007/10/17/tcl-tk-capturando-e-tratando-erros/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3e695c2389b7d5dfae9b15bd39b3379c?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">olarva</media:title>
		</media:content>
	</item>
		<item>
		<title>Tcl/Tk: Reduzindo linhas</title>
		<link>http://codare.net/2007/10/03/tcl-tk-reduzindo-linhas/</link>
		<comments>http://codare.net/2007/10/03/tcl-tk-reduzindo-linhas/#comments</comments>
		<pubDate>Wed, 03 Oct 2007 12:30:00 +0000</pubDate>
		<dc:creator>Lauro Cesar</dc:creator>
				<category><![CDATA[Tcl-Tk]]></category>

		<guid isPermaLink="false">http://codare.net/2007/10/03/tcltk-reduzindo-linhas/</guid>
		<description><![CDATA[Palavras-chave: Tcl/Tk, pack, grid, place
A sintaxe padrão para a criação de widgets é:

  widget toplevel.my_id opções_do_widget
  pack toplevel.my_id opções_do_pack

Mas também é possível reunir tudo em uma só linha:

  pack [widget toplevel.my_id opções_do_widget] opções_do_pack

Por exemplo:

  label .my_label -text "Oi Mundo!" -bg red -fg yellow
  pack .my_label -expand yes -fill x

Também pode ser escrito como:

  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codare.net&blog=417062&post=169&subd=codare&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Palavras-chave: Tcl/Tk, pack, grid, place</p>
<p>A sintaxe padrão para a criação de widgets é:</p>
<pre>
  widget toplevel.my_id opções_do_widget
  pack toplevel.my_id opções_do_pack
</pre>
<p>Mas também é possível reunir tudo em uma só linha:</p>
<pre>
  pack [widget toplevel.my_id opções_do_widget] opções_do_pack
</pre>
<p>Por exemplo:</p>
<pre>
  label .my_label -text "Oi Mundo!" -bg red -fg yellow
  pack .my_label -expand yes -fill x
</pre>
<p>Também pode ser escrito como:</p>
<pre>
  pack [label .my_label -text "Oi Mundo!" -bg red -fg yellow] \
       -expand yes -fill x
</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/codare.wordpress.com/169/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/codare.wordpress.com/169/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codare.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codare.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codare.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codare.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codare.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codare.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codare.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codare.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codare.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codare.wordpress.com/169/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codare.net&blog=417062&post=169&subd=codare&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://codare.net/2007/10/03/tcl-tk-reduzindo-linhas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3e695c2389b7d5dfae9b15bd39b3379c?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">olarva</media:title>
		</media:content>
	</item>
	</channel>
</rss>