<?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/"
	>

<channel>
	<title>A Passionate Developer from the Third World Putting Things into his World's Perspective &#187; Python</title>
	<atom:link href="http://www.cybervaldez.com/category/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cybervaldez.com</link>
	<description></description>
	<lastBuildDate>Thu, 15 Jul 2010 06:04:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Super Tip: Pass Arguments in your Python Bindings using Lambda Functions</title>
		<link>http://www.cybervaldez.com/super-tip-pass-arguments-in-your-python-bindings-using-lambda-functions/2009/</link>
		<comments>http://www.cybervaldez.com/super-tip-pass-arguments-in-your-python-bindings-using-lambda-functions/2009/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 18:38:15 +0000</pubDate>
		<dc:creator>Cyber Valdez</dc:creator>
				<category><![CDATA[How-tos]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Super Tip!]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[event.binding]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[how]]></category>
		<category><![CDATA[important]]></category>
		<category><![CDATA[lambda]]></category>
		<category><![CDATA[pyhook]]></category>
		<category><![CDATA[super]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[to]]></category>
		<category><![CDATA[troubleshoot]]></category>

		<guid isPermaLink="false">http://www.cybervaldez.com/?p=1102</guid>
		<description><![CDATA[Problem:  Help! How can I pass parameters in my Bindings?
Solution:  By using lambda functions in python(Check your PL&#8217;s manual for anything similar), you would be able to create on-the-fly functions that returns your bindings with the extra parameters/arguments you want to pass.
Example 1: Passing an argument to a wx Button Event

btn = wx.Button(self, [...]


Related posts:<ol><li><a href='http://www.cybervaldez.com/super-tip-how-to-create-that-floating-facebook-toolbar-at-the-bottom-of-the-page/2009/' rel='bookmark' title='Permanent Link: Super Tip! How to Create that floating Facebook toolbar at the bottom of the page!'>Super Tip! How to Create that floating Facebook toolbar at the bottom of the page!</a> <small>Help! I&#8217;d like to create a toolbar similar to facebook...</small></li><li><a href='http://www.cybervaldez.com/jquery-super-tip-automatically-highlight-the-linksmenu-of-the-current-page-with-1-line-of-code/2009/' rel='bookmark' title='Permanent Link: Jquery Super Tip! Automatically highlight the links/menu of the current page with 1 line of code'>Jquery Super Tip! Automatically highlight the links/menu of the current page with 1 line of code</a> <small> One very important usability feature of a website is...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p><strong>Problem: </strong> Help! How can I pass parameters in my Bindings?</p>
<p><strong>Solution: </strong> By using lambda functions in python(Check your PL&#8217;s manual for anything similar), you would be able to create on-the-fly functions that returns your bindings with the extra parameters/arguments you want to pass.</p>
<p>Example 1: Passing an argument to a wx Button Event</p>
<blockquote><p>
btn = wx.Button(self, 10, &#8220;Button&#8221;, (10, 10))<br />
self.Bind(wx.EVT_BUTTON, lambda event: self.OnClick(event, &#8216;passthis&#8217;))</p>
<p>def OnClick(self, event, somearg):<br />
&nbsp;&nbsp; print somearg
</p></blockquote>
<p>Example 2: Passing an argument to Pyhook&#8217;s HookManager.KeyUp Event</p>
<blockquote><p>
hook = pyHook.HookManager()<br />
hook.KeyUp = lambda event: OnKeyboardEvent(event, &#8216;Pass Me.&#8217;)<br />
hm.HookKeyboard()</p>
<p>def OnKeyboardEvent(event, myarg)<br />
&nbsp;&nbsp;print myarg
</p></blockquote>
<p><strong>That&#8217;s It!</strong></p>


<p>Related posts:<ol><li><a href='http://www.cybervaldez.com/super-tip-how-to-create-that-floating-facebook-toolbar-at-the-bottom-of-the-page/2009/' rel='bookmark' title='Permanent Link: Super Tip! How to Create that floating Facebook toolbar at the bottom of the page!'>Super Tip! How to Create that floating Facebook toolbar at the bottom of the page!</a> <small>Help! I&#8217;d like to create a toolbar similar to facebook...</small></li><li><a href='http://www.cybervaldez.com/jquery-super-tip-automatically-highlight-the-linksmenu-of-the-current-page-with-1-line-of-code/2009/' rel='bookmark' title='Permanent Link: Jquery Super Tip! Automatically highlight the links/menu of the current page with 1 line of code'>Jquery Super Tip! Automatically highlight the links/menu of the current page with 1 line of code</a> <small> One very important usability feature of a website is...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.cybervaldez.com/super-tip-pass-arguments-in-your-python-bindings-using-lambda-functions/2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to: Count your regex pattern matches in python</title>
		<link>http://www.cybervaldez.com/how-to-count-your-regex-pattern-matches-in-python/2009/</link>
		<comments>http://www.cybervaldez.com/how-to-count-your-regex-pattern-matches-in-python/2009/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 15:46:51 +0000</pubDate>
		<dc:creator>Cyber Valdez</dc:creator>
				<category><![CDATA[How-tos]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[count]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[expression]]></category>
		<category><![CDATA[matches]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[pattern]]></category>
		<category><![CDATA[re]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[regular]]></category>
		<category><![CDATA[times]]></category>

		<guid isPermaLink="false">http://www.cybervaldez.com/?p=1030</guid>
		<description><![CDATA[A solution in python for displaying the count of your regular expression matches.


No related posts.]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong> I need to display the number of times my regex has matched.</p>
<p>Solution: No Problem! Use the <strong>len</strong> (abbrev. for length) function:</p>
<blockquote><p>
import re<br />
>>> regex = re.compile(r&#8221;your pattern here&#8230;*&#8221;)<br />
>>> match = regex.findall(&#8221;the contents&#8230;&#8221;)<br />
>>> len(match)<br />
10
</p></blockquote>
<p><strong>That&#8217;s It!</strong></p>
<p><a href="http://www.stumbleupon.com/submit?url=http://www.cybervaldez.com/how-to-count-your-regex-pattern-matches-in-python/2009/%26title%3DThe%2BArticle%2BTitle"> <img border=0 src="http://cdn.stumble-upon.com/images/120x20_thumb_black.gif" alt="120x20 thumb black How to: Count your regex pattern matches in python"  title="How to: Count your regex pattern matches in python" /></a></p>
<p>On a side note, you can also use len to count the number of characters in a string.</p>
<blockquote><p>
>>> text = &#8220;All your base&#8230;&#8221;<br />
>>> len(text)<br />
16
</p></blockquote>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.cybervaldez.com/how-to-count-your-regex-pattern-matches-in-python/2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
