<?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>Rusty Razor Blade &#187; python</title>
	<atom:link href="http://www.rustyrazorblade.com/category/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rustyrazorblade.com</link>
	<description>Tech Thoughts, Mostly on LAMP - by Jon Haddad</description>
	<lastBuildDate>Wed, 21 Jul 2010 20:42:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Python Module Docs</title>
		<link>http://www.rustyrazorblade.com/2010/04/python-module-docs/</link>
		<comments>http://www.rustyrazorblade.com/2010/04/python-module-docs/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 00:12:05 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=1076</guid>
		<description><![CDATA[I&#8217;ve been trying to get into Python in my spare time, since it&#8217;s got such a huge volume of modules and looks like it should be easy to be ripping it up in no time.    But of course, I have my complaints.
Fortunately I don&#8217;t need to write a long blog post, this [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been trying to get into Python in my spare time, since it&#8217;s got such a huge volume of modules and looks like it should be easy to be ripping it up in no time.    But of course, I have my complaints.</p>
<p>Fortunately I don&#8217;t need to write a long blog post, <a href="http://www.russellbeattie.com/blog/python-library-docs-still-suck">this guy did it for me.</a>  It&#8217;s kind of alarming this post is from 2 years ago and the docs are still a major problem.</p>
<p>I&#8217;ve got a gripe with every language (who doesn&#8217;t?) but this is really killing me.  Such great potential.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2010/04/python-module-docs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PyDev Tutorial</title>
		<link>http://www.rustyrazorblade.com/2009/11/pydev-tutorial/</link>
		<comments>http://www.rustyrazorblade.com/2009/11/pydev-tutorial/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 20:54:23 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[eclipse]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=899</guid>
		<description><![CDATA[I found a good tutorial on IBM on doing Python development with Eclipse.  It might be a little out of date, but I think only the screens got moved around a little bit.  It includes details on how to use ant, which I&#8217;ve recently started using with cruise control and PHP, so I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>I found a good <a href="http://www.ibm.com/developerworks/library/os-ecant/">tutorial</a> on IBM on doing Python development with Eclipse.  It might be a little out of date, but I think only the screens got moved around a little bit.  It includes details on how to use ant, which I&#8217;ve recently started using with cruise control and PHP, so I&#8217;m becoming a fan.</p>
<p>I did run into an issue where I&#8217;d get the error &#8216;Variable references empty selection: ${project_loc}”, but a quick google brought me to a solution <a href="http://juddsolutions.blogspot.com/2008/07/eclipse-projectloc-errors-during-grails.html">here</a>.</p>
<p>I only had PDT installed, which doesn&#8217;t come with the Ant tools.  You just need to install the Eclipse Java Development Tools.  Found that tip on <a href="http://stackoverflow.com/questions/417074/eclipse-pdt-ant">Stack Overflow</a>.</p>
<p>Otherwise, a great tutorial on how to get working with Eclipse and Python.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2009/11/pydev-tutorial/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PyTables user&#8217;s guide</title>
		<link>http://www.rustyrazorblade.com/2009/10/pytables-users-guide/</link>
		<comments>http://www.rustyrazorblade.com/2009/10/pytables-users-guide/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 03:01:06 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[pytables]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/2009/10/pytables-users-guide/</guid>
		<description><![CDATA[I finally found the manual for PyTables.  In case anyone else is as blind as I am, I&#8217;m linking to it here.
]]></description>
			<content:encoded><![CDATA[<p>I finally found the manual for PyTables.  In case anyone else is as blind as I am, I&#8217;m linking to it <a href="http://www.pytables.org/docs/manual/index.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2009/10/pytables-users-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing NumPy on MacOS X Snow Leopard</title>
		<link>http://www.rustyrazorblade.com/2009/09/installing-numpy/</link>
		<comments>http://www.rustyrazorblade.com/2009/09/installing-numpy/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 19:24:08 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[fortran]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[numpy]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=853</guid>
		<description><![CDATA[NumPy is a requirement to work with PyTables.  This is the second step in the install process, after getting HDF5 set up.
These instructions are based on the ones found on the NumPy site, but I&#8217;m summarizing things for my own use later on.
First, you&#8217;ll need to install the Fortran compiler for OSX (gFortran).  [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://numpy.scipy.org/">NumPy</a> is a requirement to work with <a href="http://www.pytables.org/moin">PyTables</a>.  This is the second step in the install process, after getting <a href="/2009/09/issues-compiling-hdf5-on-macos-x-snow-leopard/">HDF5 set up.</a></p>
<p>These instructions are based on the ones found on the NumPy site, but I&#8217;m summarizing things for my own use later on.</p>
<p>First, you&#8217;ll need to install the Fortran compiler for OSX (gFortran).  Fortunately there&#8217;s a <a href="http://r.research.att.com/gfortran-4.2.3.dmg">Fortran universal binary installer.</a> </p>
<p>Next, get the NumPy source.  You can <a href="http://sourceforge.net/projects/numpy/files/">find it on Sourceforge</a>.  </p>
<p>Now, build with gFortran.</p>
<blockquote><p>python setup.py build &#8211;fcompiler=gnu95<br />
python setup.py install
</p></blockquote>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2009/09/installing-numpy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Issues Compiling HDf5 1.8.3 on MacOS X Snow Leopard</title>
		<link>http://www.rustyrazorblade.com/2009/09/issues-compiling-hdf5-on-macos-x-snow-leopard/</link>
		<comments>http://www.rustyrazorblade.com/2009/09/issues-compiling-hdf5-on-macos-x-snow-leopard/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 19:01:03 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[hdf5]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=848</guid>
		<description><![CDATA[I&#8217;m trying to evaluate pytables as a replacement for very large Python dictionaries, but having some issues getting HDF5 installed on my Mac (OS X Snow Leopard).  
I&#8217;ve been getting this error:
configure: error: C compiler cannot create executables
I haven&#8217;t been able to figure out what&#8217;s wrong yet &#8211; anyone have any ideas?  I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m trying to evaluate <a href="http://www.pytables.org/moin">pytables</a> as a replacement for very large Python dictionaries, but having some issues getting HDF5 installed on my Mac (OS X Snow Leopard).  </p>
<p>I&#8217;ve been getting this error:</p>
<blockquote><p>configure: error: C compiler cannot create executables</p></blockquote>
<p>I haven&#8217;t been able to figure out what&#8217;s wrong yet &#8211; anyone have any ideas?  I&#8217;ve got XCode Tools installed, I&#8217;ve compiled Apache, PHP and Memcached without issue (prior to Snow Leopard Update).</p>
<p>Help, anyone?</p>
<p><em>Edit</em>: I just found a <a href="http://discussions.apple.com/thread.jspa?threadID=2132536&#038;tstart=0">post in the Apple discussion boards</a> about this being a Snow Leopard specific issue.  The suggestion is to install XCode off the Snow Leopard disc.  I&#8217;ve reinstalled XCode, and now it successfully runs the configure command.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2009/09/issues-compiling-hdf5-on-macos-x-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mutable class instance variables in Python act like they&#8217;re static</title>
		<link>http://www.rustyrazorblade.com/2008/05/class-instance-variables-in-python-act-like-theyre-static/</link>
		<comments>http://www.rustyrazorblade.com/2008/05/class-instance-variables-in-python-act-like-theyre-static/#comments</comments>
		<pubDate>Thu, 29 May 2008 07:45:39 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=132</guid>
		<description><![CDATA[There&#8217;s a weird behavior in Python when dealing with Mutable types such as dictionaries, that when you modify a variable defined as a class attribute, you&#8217;re actually modifying a shared dictionary amongst all the classes.  This seemed weird to me.  You can read the lovely discussion about it, if you want.  Or, [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a weird behavior in Python when dealing with Mutable types such as dictionaries, that when you modify a variable defined as a class attribute, you&#8217;re actually modifying a shared dictionary amongst all the classes.  This seemed weird to me.  You can <a href="http://mail.python.org/pipermail/python-list/2001-June/088098.html">read the lovely discussion</a> about it, if you want.  Or, just follow my code for a demo on how to deal with the issue.  I just started Python on Monday night, so please overlook my n00bness.</p>
<blockquote><pre>
## the first test will use an int, which is immutable.
class test1:
	i = 0
	def add(self):
		self.i = self.i + 1

t = test1()
t.add()
t2 = test1()
t2.add()
t3 = test1()
t3.add()

## this will output 1, cool
print t3.i

## Lets try it again with a dictionary - which is a mutable type
class test2:
	i = {} ## lets use a dictionary
	def add(self, str):
		self.i[str] = 1;

t = test2()
t.add('hi');
t.add('steve');
print t.i
# Will print the expected:
# {'steve': 1, 'hi': 1}

t2 = test2()
t2.add('bacon')
print t2.i

# But this prints:
# {'steve': 1, 'hi': 1, 'bacon': 1}
# Unexpected, in most languages

## it's necessary to define test2 in the following manner to avoid this weirdness

class test2:
	def __init__(self):
		self.i = {}
	def add(self, str):
		self.i[str] = 1;

t = test2()
t.add('hi');
t.add('steve');
print t.i
# Will print the expected:
# {'steve': 1, 'hi': 1}

t2 = test2()
t2.add('bacon')
print t2.i		

# Will now print the expected:
# {'bacon': 1}
</pre>
</blockquote>
<p>Reading the link above is a good idea if you&#8217;re interested to know why something works the way it does.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2008/05/class-instance-variables-in-python-act-like-theyre-static/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting phpsh to work on a mac</title>
		<link>http://www.rustyrazorblade.com/2007/12/getting-phpsh-to-work-on-a-mac/</link>
		<comments>http://www.rustyrazorblade.com/2007/12/getting-phpsh-to-work-on-a-mac/#comments</comments>
		<pubDate>Tue, 18 Dec 2007 18:14:09 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/index.php/2007/12/18/getting-phpsh-to-work-on-a-mac/</guid>
		<description><![CDATA[I had an issue getting phpsh to work on my mac &#8211; I kept getting the following error:
Traceback (most recent call last):
  File &#8220;./phpsh&#8221;, line 20, in 
    import readline
OK, seems easy enough.  So I compiled python with readline support.
./configure &#8211;prefix=/usr/local/python &#8211;enable-readline 
I change the PATH variable in my .bash_profile [...]]]></description>
			<content:encoded><![CDATA[<p>I had an issue getting phpsh to work on my mac &#8211; I kept getting the following error:</p>
<blockquote><p>Traceback (most recent call last):<br />
  File &#8220;./phpsh&#8221;, line 20, in <module><br />
    import readline</p></blockquote>
<p>OK, seems easy enough.  So I compiled python with readline support.</p>
<blockquote><p>./configure &#8211;prefix=/usr/local/python &#8211;enable-readline </p></blockquote>
<p>I change the PATH variable in my .bash_profile to point to the /usr/local/python directory first, and source&#8217;d it to get the new PATH settings.  Still get the same error.</p>
<p>Usually at this point I&#8217;d like to tell you what was wrong, and how I fixed it.  But you know what &#8211; I never figured it out.  I just installed the python binary from python.org.  And it works.</p>
<p>Sometimes it&#8217;s just not worth fighting the battle.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2007/12/getting-phpsh-to-work-on-a-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
