<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Python From The PHP Perspective</title>
	<atom:link href="http://blog.gordaen.com/2007/12/13/python-from-the-php-perspective/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.gordaen.com/2007/12/13/python-from-the-php-perspective/</link>
	<description>Ramblings about art, education, Linux and a lot more</description>
	<pubDate>Thu, 20 Nov 2008 14:49:09 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Gordaen</title>
		<link>http://blog.gordaen.com/2007/12/13/python-from-the-php-perspective/#comment-51230</link>
		<dc:creator>Gordaen</dc:creator>
		<pubDate>Thu, 20 Dec 2007 04:18:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gordaen.com/2007/12/13/python-from-the-php-perspective/#comment-51230</guid>
		<description>The advantage of the backtick method is that you don't have to know if the variable is an int or a string.  I was aware of the %d, %s, etc. method, but I did not know about the tokens, so thanks for sharing that.  Apparently you can use %s with non-strings just fine, so maybe that's the method of choice.

Haha, I love &lt;a href="http://xkcd.com/" rel="nofollow"&gt;xkcd&lt;/a&gt;.  I decided to actually finally go through all of the archives a month or two ago and have been keeping up via RSS since.

The &lt;em&gt;Python in a Nutshell&lt;/em&gt; book is great as a reference, though I find that &lt;a href="http://www.diveintopython.org/" rel="nofollow"&gt;Dive into Python&lt;/a&gt; has better examples in many cases (more "real world" as opposed to just demonstrating what a statement looks like).  Funny that you should mention &lt;a href="http://www.djangoproject.com/" rel="nofollow"&gt;Django&lt;/a&gt;, as that's pretty much been the reason for the change to Python at my work.  Python, by itself, is not great for web projects, but Django is a very good framework.

As far as installing a "personal" Python (or anything else for that matter) at Dreamhost, that's the way to go.  Even installing a personal copy of PHP lets you better configure the software, but the problem is that many hosts won't let you do that.  Then you're stuck with whatever version they have (if any at all).  I'll likely be going to a VPS solution within the next 4 or so months, so that won't be a worry for me.  It's more of a consideration for the new programmer who only wants to shell out a few bucks for some web space.</description>
		<content:encoded><![CDATA[<p>The advantage of the backtick method is that you don&#8217;t have to know if the variable is an int or a string.  I was aware of the %d, %s, etc. method, but I did not know about the tokens, so thanks for sharing that.  Apparently you can use %s with non-strings just fine, so maybe that&#8217;s the method of choice.</p>
<p>Haha, I love <a href="http://xkcd.com/" rel="nofollow" onclick="javascript:pageTracker._trackPageview ('/outbound/xkcd.com');">xkcd</a>.  I decided to actually finally go through all of the archives a month or two ago and have been keeping up via RSS since.</p>
<p>The <em>Python in a Nutshell</em> book is great as a reference, though I find that <a href="http://www.diveintopython.org/" rel="nofollow" onclick="javascript:pageTracker._trackPageview ('/outbound/www.diveintopython.org');">Dive into Python</a> has better examples in many cases (more &#8220;real world&#8221; as opposed to just demonstrating what a statement looks like).  Funny that you should mention <a href="http://www.djangoproject.com/" rel="nofollow" onclick="javascript:pageTracker._trackPageview ('/outbound/www.djangoproject.com');">Django</a>, as that&#8217;s pretty much been the reason for the change to Python at my work.  Python, by itself, is not great for web projects, but Django is a very good framework.</p>
<p>As far as installing a &#8220;personal&#8221; Python (or anything else for that matter) at Dreamhost, that&#8217;s the way to go.  Even installing a personal copy of PHP lets you better configure the software, but the problem is that many hosts won&#8217;t let you do that.  Then you&#8217;re stuck with whatever version they have (if any at all).  I&#8217;ll likely be going to a VPS solution within the next 4 or so months, so that won&#8217;t be a worry for me.  It&#8217;s more of a consideration for the new programmer who only wants to shell out a few bucks for some web space.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mason</title>
		<link>http://blog.gordaen.com/2007/12/13/python-from-the-php-perspective/#comment-51217</link>
		<dc:creator>Mason</dc:creator>
		<pubDate>Thu, 20 Dec 2007 02:08:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gordaen.com/2007/12/13/python-from-the-php-perspective/#comment-51217</guid>
		<description>Additionally (and sorry for repeatedly spamming your blog... I'm kind of replying as I read), you can install Python under your Dreamhost user account if you have issue with the version they provide.  Just install from source, making sure to specify your install path during configuration. Then just make sure that directory is in your PATH, and you'll be able to soar with your own wings.</description>
		<content:encoded><![CDATA[<p>Additionally (and sorry for repeatedly spamming your blog&#8230; I&#8217;m kind of replying as I read), you can install Python under your Dreamhost user account if you have issue with the version they provide.  Just install from source, making sure to specify your install path during configuration. Then just make sure that directory is in your PATH, and you&#8217;ll be able to soar with your own wings.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mason</title>
		<link>http://blog.gordaen.com/2007/12/13/python-from-the-php-perspective/#comment-51215</link>
		<dc:creator>Mason</dc:creator>
		<pubDate>Thu, 20 Dec 2007 02:00:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gordaen.com/2007/12/13/python-from-the-php-perspective/#comment-51215</guid>
		<description>Additionally, you may find this entertaining: http://xkcd.com/353/

I have a heavy PHP background as well...  Python didn't really fascinate me until I really started exploring...  Ruby lent a helping hand.

If you want a super-sweet reference on all the little sweet things Python can do, pick up Python in a Nutshell. 

If you want a Pythonic web framework, check out Django. Holovaty and JKM just released a great reference on it.</description>
		<content:encoded><![CDATA[<p>Additionally, you may find this entertaining: <a href="http://xkcd.com/353/" rel="nofollow">http://xkcd.com/353/</a></p>
<p>I have a heavy PHP background as well&#8230;  Python didn&#8217;t really fascinate me until I really started exploring&#8230;  Ruby lent a helping hand.</p>
<p>If you want a super-sweet reference on all the little sweet things Python can do, pick up Python in a Nutshell. </p>
<p>If you want a Pythonic web framework, check out Django. Holovaty and JKM just released a great reference on it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mason</title>
		<link>http://blog.gordaen.com/2007/12/13/python-from-the-php-perspective/#comment-51214</link>
		<dc:creator>Mason</dc:creator>
		<pubDate>Thu, 20 Dec 2007 01:57:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gordaen.com/2007/12/13/python-from-the-php-perspective/#comment-51214</guid>
		<description>If this is messing you up:

print "there are many (", x, ") parts"

You could try:

print "there are many (%d) parts" % x

or used named tokens:

tokens = {'part_count':34}
print "there are many (%(part_count)) pargs" % tokens

Also lends a bit to clarity.</description>
		<content:encoded><![CDATA[<p>If this is messing you up:</p>
<p>print &#8220;there are many (&#8221;, x, &#8220;) parts&#8221;</p>
<p>You could try:</p>
<p>print &#8220;there are many (%d) parts&#8221; % x</p>
<p>or used named tokens:</p>
<p>tokens = {&#8217;part_count&#8217;:34}<br />
print &#8220;there are many (%(part_count)) pargs&#8221; % tokens</p>
<p>Also lends a bit to clarity.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gordaen</title>
		<link>http://blog.gordaen.com/2007/12/13/python-from-the-php-perspective/#comment-50029</link>
		<dc:creator>Gordaen</dc:creator>
		<pubDate>Sat, 15 Dec 2007 01:35:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gordaen.com/2007/12/13/python-from-the-php-perspective/#comment-50029</guid>
		<description>LOL!  I added the pre tag so we can marvel at your awesomeness :D

For anyone interested, the &lt;a href="http://www.python.org/doc/faq/general/" rel="nofollow"&gt;Python FAQ&lt;/a&gt; has a few answers to some of my problems.  Each of the answers generally is not so much of a "that's because it makes sense for the coder" answer as a "that's how it has always been" or "it's because of the way Python is implemented" answer.</description>
		<content:encoded><![CDATA[<p>LOL!  I added the pre tag so we can marvel at your awesomeness <img src='http://blog.gordaen.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>For anyone interested, the <a href="http://www.python.org/doc/faq/general/" rel="nofollow" onclick="javascript:pageTracker._trackPageview ('/outbound/www.python.org');">Python FAQ</a> has a few answers to some of my problems.  Each of the answers generally is not so much of a &#8220;that&#8217;s because it makes sense for the coder&#8221; answer as a &#8220;that&#8217;s how it has always been&#8221; or &#8220;it&#8217;s because of the way Python is implemented&#8221; answer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Schumacher</title>
		<link>http://blog.gordaen.com/2007/12/13/python-from-the-php-perspective/#comment-50015</link>
		<dc:creator>Josh Schumacher</dc:creator>
		<pubDate>Sat, 15 Dec 2007 00:28:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gordaen.com/2007/12/13/python-from-the-php-perspective/#comment-50015</guid>
		<description>crap, forgot to wrap my code in a pre tag, guess it won't compile now.</description>
		<content:encoded><![CDATA[<p>crap, forgot to wrap my code in a pre tag, guess it won&#8217;t compile now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Schumacher</title>
		<link>http://blog.gordaen.com/2007/12/13/python-from-the-php-perspective/#comment-50011</link>
		<dc:creator>Josh Schumacher</dc:creator>
		<pubDate>Sat, 15 Dec 2007 00:17:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gordaen.com/2007/12/13/python-from-the-php-perspective/#comment-50011</guid>
		<description>&lt;pre&gt;
#!/usr/bin/python

import sys
import web
from web import *
import magic
from magic import OCR

class CodeSample:
    def __init__(self):
        myCode = magic.OCR.ReadFromWeb('http://blog.gordaen.com/wp-content/uploads/2007/12/recent_sites.png')
        print myCode
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<pre>
#!/usr/bin/python

import sys
import web
from web import *
import magic
from magic import OCR

class CodeSample:
    def __init__(self):
        myCode = magic.OCR.ReadFromWeb('http://blog.gordaen.com/wp-content/uploads/2007/12/recent_sites.png')
        print myCode
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.231 seconds -->
