<?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>Code Comments &#187; Python</title>
	<atom:link href="http://code.hammerpig.com/category/python/feed" rel="self" type="application/rss+xml" />
	<link>http://code.hammerpig.com</link>
	<description>Tips and short tutorials on various programming technologies</description>
	<lastBuildDate>Tue, 25 May 2010 14:35:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Dynamically Invoke a Function in Python</title>
		<link>http://code.hammerpig.com/dynamically-invoke-function-python.html</link>
		<comments>http://code.hammerpig.com/dynamically-invoke-function-python.html#comments</comments>
		<pubDate>Thu, 25 Mar 2010 16:56:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Reflection]]></category>

		<guid isPermaLink="false">http://code.hammerpig.com/?p=624</guid>
		<description><![CDATA[In this post, I referred to an article that explains how to invoke methods dynamically (when you have the name of the method as a string object). Today I ran into a problem where I needed to do this, but the methods were not contained within a class. I just had them declared in my [...]]]></description>
		<wfw:commentRss>http://code.hammerpig.com/dynamically-invoke-function-python.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Get File Name from File Path in Python</title>
		<link>http://code.hammerpig.com/file-file-path-python-2.html</link>
		<comments>http://code.hammerpig.com/file-file-path-python-2.html#comments</comments>
		<pubDate>Thu, 03 Dec 2009 16:53:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://code.hammerpig.com/file-file-path-python-2.html</guid>
		<description><![CDATA[Let&#8217;s say you did a search for files matching a certain pattern in a directory using Python:

import glob
&#160;
filePaths = glob.glob&#40;&#34;C:\\Temp\\*.txt&#34;&#41;
print filePaths

This will list the full file paths with a .txt extension in the C:\Temp directory. For example: C:\\Temp\\test.txt.
But if you wanted to get just the file name, how would you go about that? It took [...]]]></description>
		<wfw:commentRss>http://code.hammerpig.com/file-file-path-python-2.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Minimum or Maximum Float Value in Python 2.5</title>
		<link>http://code.hammerpig.com/minimum-maximum-float-python-25.html</link>
		<comments>http://code.hammerpig.com/minimum-maximum-float-python-25.html#comments</comments>
		<pubDate>Wed, 08 Jul 2009 20:09:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://code.hammerpig.com/?p=549</guid>
		<description><![CDATA[In Python 2.5, there is a built-in function that tells you the maximum allowable int value:

import sys
print sys.maxint

But there is no corresponding function to do this for float values. Part of the reason may be that it can vary from system to system. But actually, I believe they added this in version 2.6. So this [...]]]></description>
		<wfw:commentRss>http://code.hammerpig.com/minimum-maximum-float-python-25.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to List All Methods in a Python Object</title>
		<link>http://code.hammerpig.com/list-methods-python-object.html</link>
		<comments>http://code.hammerpig.com/list-methods-python-object.html#comments</comments>
		<pubDate>Wed, 17 Jun 2009 20:11:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Reflection]]></category>

		<guid isPermaLink="false">http://code.hammerpig.com/?p=543</guid>
		<description><![CDATA[Suppose you have an object in Python that you retrieved from a third-party library, but you don&#8217;t have access to the source code or to very good documentation. Believe me, it happens (and did to me today). You can use a simple built-in method in Python to find out which methods are exposed by a [...]]]></description>
		<wfw:commentRss>http://code.hammerpig.com/list-methods-python-object.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Invoke External Application in Java</title>
		<link>http://code.hammerpig.com/invoke-external-application-java.html</link>
		<comments>http://code.hammerpig.com/invoke-external-application-java.html#comments</comments>
		<pubDate>Thu, 04 Jun 2009 22:27:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://code.hammerpig.com/?p=541</guid>
		<description><![CDATA[I recently had a scenario where part of what I wanted to do was in Java, and the other part was in an application that was written in Python. Rather than than rewrite my entire code base in one language or the other, I wanted to find a (quick and dirty) way to invoke the [...]]]></description>
		<wfw:commentRss>http://code.hammerpig.com/invoke-external-application-java.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Last Index Of&#8221; for Python Strings</title>
		<link>http://code.hammerpig.com/index-python-strings.html</link>
		<comments>http://code.hammerpig.com/index-python-strings.html#comments</comments>
		<pubDate>Thu, 16 Apr 2009 21:38:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://code.hammerpig.com/?p=539</guid>
		<description><![CDATA[In Java and C#, there is a method that enables you to find the last occurrence of a given sequence of string characters within a string. This method is sometimes called &#8220;lastIndexOf.&#8221; A method by this name does not exist in Python. But there is an easy way to do it if you know what [...]]]></description>
		<wfw:commentRss>http://code.hammerpig.com/index-python-strings.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a Reverse Sequence of Numbers in Python</title>
		<link>http://code.hammerpig.com/creating-reverse-sequence-numbers-python.html</link>
		<comments>http://code.hammerpig.com/creating-reverse-sequence-numbers-python.html#comments</comments>
		<pubDate>Wed, 14 Jan 2009 15:15:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Collections]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://code.hammerpig.com/?p=529</guid>
		<description><![CDATA[Let&#8217;s say you want to create a sequence of numbers in reverse order (for example, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1). I tried to do this with the range function, but I couldn&#8217;t find a way to do it. But Python has a built-in function called reversed that allows you to [...]]]></description>
		<wfw:commentRss>http://code.hammerpig.com/creating-reverse-sequence-numbers-python.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Find the Mean/Average of a Number List in Python</title>
		<link>http://code.hammerpig.com/find-meanaverage-number-list-python.html</link>
		<comments>http://code.hammerpig.com/find-meanaverage-number-list-python.html#comments</comments>
		<pubDate>Fri, 02 Jan 2009 20:29:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Statistics]]></category>

		<guid isPermaLink="false">http://code.hammerpig.com/?p=513</guid>
		<description><![CDATA[To my knowledge, there is no built-in function in Python to find the mean of a list of numbers. You can use statistics packages to do this, such as statpy, but if you just want a lightweight solution to do the trick you can use the function below. Note that on the first line I [...]]]></description>
		<wfw:commentRss>http://code.hammerpig.com/find-meanaverage-number-list-python.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Find the Class of a Python Object</title>
		<link>http://code.hammerpig.com/find-class-python-object.html</link>
		<comments>http://code.hammerpig.com/find-class-python-object.html#comments</comments>
		<pubDate>Thu, 01 Jan 2009 04:13:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://code.hammerpig.com/?p=508</guid>
		<description><![CDATA[Sometimes you are working with an object in Python, and because Python is not a strongly typed language, you don&#8217;t always know which class it is an implementation of. A quick way to find out is to use the type method, which can be invoked on any object and gives you a String representation of [...]]]></description>
		<wfw:commentRss>http://code.hammerpig.com/find-class-python-object.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Override toString() in Python</title>
		<link>http://code.hammerpig.com/tostring-python.html</link>
		<comments>http://code.hammerpig.com/tostring-python.html#comments</comments>
		<pubDate>Thu, 01 Jan 2009 04:08:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://code.hammerpig.com/?p=506</guid>
		<description><![CDATA[In popular object-oriented languages such as Java and C#, they have a built-in method to each class that allows you to obtain a String representation of that class. They call these methods toString() or ToString(), respectively. You can use the default implementation, which basically gives you the name of the class (not usually very helpful). [...]]]></description>
		<wfw:commentRss>http://code.hammerpig.com/tostring-python.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
