<?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 For Days &#187; Python</title>
	<atom:link href="http://www.emgarten.com/category/python/feed" rel="self" type="application/rss+xml" />
	<link>http://www.emgarten.com</link>
	<description>Exploring the realms of code..</description>
	<lastBuildDate>Sun, 10 Jan 2010 02:10:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Listing Files with Python</title>
		<link>http://www.emgarten.com/listing-files-with-python.htm</link>
		<comments>http://www.emgarten.com/listing-files-with-python.htm#comments</comments>
		<pubDate>Thu, 26 Apr 2007 22:09:25 +0000</pubDate>
		<dc:creator>lucius</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.emgarten.com/listing-files-with-python.htm</guid>
		<description><![CDATA[Getting a list of files in a directory and its sub directories is very simple using the built in os module in Python. In this example the file can be run with the directory to explore as the command line argument. Any directories found in the given directory will be recursed on and their files [...]]]></description>
		<wfw:commentRss>http://www.emgarten.com/listing-files-with-python.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Datetime string to a Timestamp</title>
		<link>http://www.emgarten.com/mysql-datetime-to-python-timestamp.htm</link>
		<comments>http://www.emgarten.com/mysql-datetime-to-python-timestamp.htm#comments</comments>
		<pubDate>Mon, 16 Apr 2007 23:51:45 +0000</pubDate>
		<dc:creator>lucius</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.emgarten.com/15.htm</guid>
		<description><![CDATA[Here is a simple function to convert a datetime string from MySQL to a UNIX timestamp using Python.

 import time
# Converts an SQL datetime to a UNIX timestamp
# Example datetime: 2007-04-15 08:29:39
def sqlDateTimeToTimeStamp(sqlDateTime):
return int(time.mktime(time.strptime\
(sqlDateTime,\
&#8220;%Y-%m-%d %H:%M:%S&#8221;)))
]]></description>
		<wfw:commentRss>http://www.emgarten.com/mysql-datetime-to-python-timestamp.htm/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Power of the Python FOR loop</title>
		<link>http://www.emgarten.com/power-of-the-python-for-loop.htm</link>
		<comments>http://www.emgarten.com/power-of-the-python-for-loop.htm#comments</comments>
		<pubDate>Fri, 19 Jan 2007 22:26:38 +0000</pubDate>
		<dc:creator>lucius</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.emgarten.com/power-of-the-python-for-loop.htm</guid>
		<description><![CDATA[The FOR loop in Python can do a few more tricks then it can in other languages, and works in slightly different ways in what it pulls out depending on what object type you are looping on.

Looping on a String
x = &#8220;text&#8221;
for c in x:

print c
The Result:
t
e
x
t
The for loop loops over each character in the [...]]]></description>
		<wfw:commentRss>http://www.emgarten.com/power-of-the-python-for-loop.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python Quicksort</title>
		<link>http://www.emgarten.com/python-quicksort.htm</link>
		<comments>http://www.emgarten.com/python-quicksort.htm#comments</comments>
		<pubDate>Thu, 18 Jan 2007 23:39:48 +0000</pubDate>
		<dc:creator>lucius</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.emgarten.com/python-quicksort.htm</guid>
		<description><![CDATA[Here is simple quick sort function written in Python to sort a list of numbers.

def qsort(toSort):

# return the list if only one is left
if len(toSort) &#60; = 1:

return toSort
# set the value to pivot around
pivot = toSort[0] # initialize lists
less = []
greater = []
# sort the list
# skip the first value
for item in toSort[1:]:

if item [...]]]></description>
		<wfw:commentRss>http://www.emgarten.com/python-quicksort.htm/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Python and MySQL</title>
		<link>http://www.emgarten.com/python-and-mysql.htm</link>
		<comments>http://www.emgarten.com/python-and-mysql.htm#comments</comments>
		<pubDate>Thu, 18 Jan 2007 21:36:04 +0000</pubDate>
		<dc:creator>lucius</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.emgarten.com/python-and-mysql.htm</guid>
		<description><![CDATA[A MySQL database can be queried from a python script with MySQLdb. Just download it here and install it, or if you are using FreeBSD it can be found under
/usr/ports/databases/py-MySQLdb.

In the python script import the MySQLdb module and declare a connection in cursor as in this example:
import MySQLdb
# Create a connection using your db info
db [...]]]></description>
		<wfw:commentRss>http://www.emgarten.com/python-and-mysql.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
