<?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>Python Central</title>
	<atom:link href="http://pythoncentral.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://pythoncentral.org</link>
	<description>Everything Python!</description>
	<lastBuildDate>Mon, 06 Feb 2012 11:31:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to install Python 2.7 on Windows 7. &#8216;python&#8217; is not recognized as an internal or external command.</title>
		<link>http://pythoncentral.org/how-to-install-python-2-7-on-windows-7-python-is-not-recognized-as-an-internal-or-external-command/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-install-python-2-7-on-windows-7-python-is-not-recognized-as-an-internal-or-external-command</link>
		<comments>http://pythoncentral.org/how-to-install-python-2-7-on-windows-7-python-is-not-recognized-as-an-internal-or-external-command/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 17:36:38 +0000</pubDate>
		<dc:creator>sergio.gutierrez</dc:creator>
				<category><![CDATA[General Programming Tips]]></category>
		<category><![CDATA[Getting Started]]></category>
		<category><![CDATA[path variable]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[python setup windows 7]]></category>
		<category><![CDATA[windows 7]]></category>

		<guid isPermaLink="false">http://pythoncentral.org/?p=96</guid>
		<description><![CDATA[It seems this problem is more common than we&#8217;d like to admit to ourselves, but the solution is quite simple! Many developers install Python on their Windows 7 machine and when they try to run the console command Python they get the following error message: &#8216;python&#8217; is not recognized as an internal or external command,<a class="moretag" href="http://pythoncentral.org/how-to-install-python-2-7-on-windows-7-python-is-not-recognized-as-an-internal-or-external-command/">&#160;&#160;Full Article&#8230;</a>
]]></description>
			<content:encoded><![CDATA[<p>It seems this problem is more common than we&#8217;d like to admit to ourselves, but the solution is quite simple!</p>
<p>Many developers install Python on their Windows 7 machine and when they try to run the console command Python they get the following error message:</p>
<blockquote><p>&#8216;python&#8217; is not recognized as an internal or external command, operable program or batch file.</p></blockquote>
<p>Follow the steps below to see how to install and start coding in Python on Windows 7.</p>
<p><span id="more-96"></span></p>
<p>First visit the <a href="http://python.org/download/">official Python page</a> and download the latest release. At the time of this writing the latest version is 2.7.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://i.imgur.com/jgdJ6.png" alt="" width="774" height="266" /></p>
<p>Install it by double clicking the setup file and follow the wizard along.</p>
<p>Next, let&#8217;s open the <strong>Start Menu</strong> and right click <strong>My Computer</strong>. Click on <strong>Advanced System Settings</strong>.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://i.imgur.com/S1KWl.png" alt="" width="302" height="373" /></p>
<p style="text-align: center;"><img class="aligncenter" src="http://i.imgur.com/WM5Km.png" alt="" width="391" height="211" /></p>
<p>Then click on <strong>Environment Variables</strong>.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://i.imgur.com/w0jYs.png" alt="" width="298" height="332" /></p>
<p>Find the PATH variable and click <strong>Edit</strong>. You want to add <em>;C:\Python27</em> to the end of that string. Save your changes!</p>
<p style="text-align: center;"><img class="aligncenter" src="http://i.imgur.com/2jP1K.png" alt="" width="394" height="436" /></p>
<p style="text-align: center;"><img class="aligncenter" src="http://i.imgur.com/ftZmK.png" alt="" width="357" height="153" /></p>
<p>So what exactly is happening here?</p>
<p>When you type in &#8216;<em>python</em>&#8216; in a command prompt, Windows will use the PATH variable to get a list of directories to go looking for the &#8216;<em>python</em>&#8216; command. Before you followed the steps here, it couldn&#8217;t find the python.exe file, hence the error.</p>
<p>Now that the PATH variable is set, when you use <em>&#8216;python</em>&#8216; you&#8217;ll see a familiar programming prompt.</p>
<div class="wp-caption aligncenter" style="width: 687px"><img src="http://i.imgur.com/kEKri.png" alt="Python running in Windows 7." width="677" height="342" /><p class="wp-caption-text">Python running in Windows 7.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://pythoncentral.org/how-to-install-python-2-7-on-windows-7-python-is-not-recognized-as-an-internal-or-external-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to check if a string is a number in Python.</title>
		<link>http://pythoncentral.org/how-to-check-if-a-string-is-a-number-in-python/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-check-if-a-string-is-a-number-in-python</link>
		<comments>http://pythoncentral.org/how-to-check-if-a-string-is-a-number-in-python/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 17:34:45 +0000</pubDate>
		<dc:creator>sergio.gutierrez</dc:creator>
				<category><![CDATA[General Programming Tips]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[python number conversion float]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://pythoncentral.org/?p=104</guid>
		<description><![CDATA[Sometimes you want to validate user input to check if a string is a number. Using this simple function, you can check very easily!]]></description>
			<content:encoded><![CDATA[<p>Sometimes you want to validate user input to check if a string is a number. Using this simple function, you can check very easily!</p>
<pre class="brush: python; title: ; notranslate">
def is_number(s):
  try:
    float(s)
    return True
  except ValueError:
    return False

print is_number(&quot;foo&quot;) # &quot;False&quot;
print is_number(&quot;baz&quot;) # &quot;False&quot;

print is_number(1) # &quot;True&quot;
print is_number(1.3) # &quot;True&quot;
print is_number(-1.37) # &quot;True&quot;

print is_number(1e3) # &quot;True&quot;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://pythoncentral.org/how-to-check-if-a-string-is-a-number-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Object Oriented Paradigm</title>
		<link>http://pythoncentral.org/the-object-oriented-paradigm/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-object-oriented-paradigm</link>
		<comments>http://pythoncentral.org/the-object-oriented-paradigm/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 14:25:43 +0000</pubDate>
		<dc:creator>carl.smith</dc:creator>
				<category><![CDATA[The Object Oriented Paradigm]]></category>

		<guid isPermaLink="false">http://pythoncentral.org/?p=41</guid>
		<description><![CDATA[Object orientation is a central concept in Python, as well as many other languages. Understanding the concept, and applying it well, will enable you to build much more elegant and manageable software. Everything&#8217;s An Object You&#8217;ll often hear it said that, in Python, everything&#8217;s an object. It&#8217;s pretty much true, with a few exceptions. An<a class="moretag" href="http://pythoncentral.org/the-object-oriented-paradigm/">&#160;&#160;Full Article&#8230;</a>
]]></description>
			<content:encoded><![CDATA[<p>Object orientation is a central concept in Python, as well as many other languages. Understanding the concept, and applying it well, will enable you to build much more elegant and manageable software.</p>
<p><em>Everything&#8217;s An Object</em></p>
<p>You&#8217;ll often hear it said that, in Python, everything&#8217;s an object. It&#8217;s pretty much true, with a few exceptions. An expression is not an object, but it always expresses one. Because the Interpreter will evaluate any expression on contact, as soon as it reads one, an expression is essentially the object it evaluates to. A name is not an object either, but it always references an object. Names are also evaluated on contact, evaluating to whichever object they reference at that point in time. So, ultimately, everything is pretty much an object.</p>
<p>Each object is of a particular type. There&#8217;s a range of different types of objects built into Python, they&#8217;re predefined, and you can also define others yourself as needed. The built-in types include String, Float, List, Function, Module and so on. You can do a lot with these built-in types, but you can do a lot more if you learn to combine them to create custom types of object, tailored to your application. You might define a SpaceInvader type, an Employee type, an Account type; it can be anything. Once you have defined, for example, an Account type, you can then create as many instances of that type as you need. In the same way that you can have as many strings as you need, you can have as many accounts as you need.</p>
<p>Classically, there was a conceptual division between data and logic. Stuff like numbers and strings and so on were data, stuff like if branches and while loops were logic, and the two things were to be kept apart. Many modern languages have a different approach, combining data and logic to create objects. An object is a singular thing, with attributes, which store data, and methods, which define logic. Pretty much any &#8216;thing&#8217; can be thought of as an object and defined in terms of its attributes and methods.</p>
<p>An object&#8217;s attributes are really just values assigned to names and the methods are just like functions, so objects are pretty easy to understand if you know a little Python already.</p>
<p>If you wanted to do some banking, you might want to define some bank account objects. You&#8217;d start by defining a new object type, we&#8217;ll call it Account. Then, you could give it two attributes, one called fullname that&#8217;d have a string assigned to it, the person&#8217;s name, and one called balance that&#8217;d have a number, maybe a float, assigned to it, the current balance. The Account type would also need a method, we&#8217;ll call it transact, which changes the value of an Account object&#8217;s balance attribute, by adding to it or subtracting from it.</p>
<p><em>Lego and Object Orientation</em></p>
<p>So why would thinking in terms of objects be useful? Think about building with Lego. Lego provides primitive object types, Bricks, Tiles, Plates and so on that we can build almost any construction with. If you only want to build a very simple model, a wall perhaps, you can get away with picking up a single brick and just adding bits until you&#8217;ve got what you want. If you want to build something more elaborate, say a city, you need to approach it differently. If you just keep adding bits to an ever expanding lump of Lego, you&#8217;ll only ever end up with a huge mess. You&#8217;ll instead need to think in terms of objects and interfaces.</p>
<p>Lego elements are objects that have pretty simple interfaces; there&#8217;s not much complexity in how bricks interface with other bricks or tiles or whatever. They can clip on the top or bottom, there&#8217;s not much to it. Because they have clean, simple interfaces, it&#8217;s easy to combine Lego elements to make more complex objects, a wall, a chimney, a fireplace. The important thing is to ensure that you build each of these new objects with simple interfaces too.</p>
<p>Well designed chimney objects have simple interfaces for attaching them to wall objects. A fireplace object should just clip onto the chimney and wall in a simple way. Assuming it&#8217;s designed well, you can forget how you made the fireplace, you may have spent a long time getting it looking just right, but it&#8217;s no longer relevant, only the complexity of its interface is an issue. So long as your fireplace clips easily into place, it doesn&#8217;t make any difference how complicated it was to build. That complexity is encapsulated inside the fireplace object, leaving only the complexity of its interface exposed.</p>
<p>If you continue combining these new objects to form an even more elaborate object, say a house, you can very easily add that house object to your city object, again assuming simple interfaces. And so on. Every object should be constructed from more primitive objects, all with simple interfaces, all the way down.</p>
<p><em>Python Objects</em></p>
<p>In Python, if you defined an Account type as discussed above, you&#8217;d realise early on that only having the account holder&#8217;s name and the current balance is not realistically going to be enough, so you may decide to include other data like the account holder&#8217;s home address, date of birth, that type of stuff, as well as things like the date the account was opened. Then, you might want methods to close the account, modify the account holder&#8217;s name, maybe they get married, it can all become a bit too much fairly quickly. However, if you think in terms of objects, it&#8217;s obvious that you&#8217;d want to separate it out a bit.</p>
<p>We can always define a new Customer type that has the attributes and methods a customer would have, then define an Account type that has the attributes and methods of a bank account. The Account type would have an attribute called account_holder that would be assigned one of your Customer type objects, instead of just a string or something.</p>
<p>Object definitions are like blueprints. You first define a new type of object, an object definition, you then create instances of that type, these instances are the objects themselves. Every object is one instance of a particular type of object. It will have the same attribute names as all other objects of the same type. For example, all Account type objects will have an account_holder attribute, but, as all instances of Account are objects in their own right, each can have something different assigned to its account_holder attribute.</p>
<p>Likewise, each instance of an object has the same methods as all other instances of the same type, but calling one instance&#8217;s method is specific to that instance. Every string has an upper method because it&#8217;s a string and the string type is defined with an upper method. You can call upper on any string, but it only affects that particular instance of String.</p>
<p>Remember, everything&#8217;s an object. The arguments you pass to a function are objects, so you can write a function that takes Customer objects as arguments and references their attributes and calls their methods. You can have a list of Account objects and iterate over the list as normal. Anything you can do with a built-in type of object, you can do with one of your own types.</p>
<p>This will all be made much more concrete in articles that cover actual Python syntax. The aim here is to try and introduce the Object Oriented Paradigm in a way that helps you understand what an object actually is, whilst also encouraging you to think about how to use them more powerfully. Python wizardry begins with OOP.</p>
]]></content:encoded>
			<wfw:commentRss>http://pythoncentral.org/the-object-oriented-paradigm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The best Python IDE&#8217;s you can use for development.</title>
		<link>http://pythoncentral.org/the-best-python-ides-you-can-use-for-development/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-best-python-ides-you-can-use-for-development</link>
		<comments>http://pythoncentral.org/the-best-python-ides-you-can-use-for-development/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 14:21:22 +0000</pubDate>
		<dc:creator>sergio.gutierrez</dc:creator>
				<category><![CDATA[General Programming Tips]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[komodo edit]]></category>
		<category><![CDATA[programmer tools]]></category>
		<category><![CDATA[pycharm]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[python ide]]></category>

		<guid isPermaLink="false">http://pythoncentral.org/?p=51</guid>
		<description><![CDATA[An IDE (Integrated Development Environment) is one of the best tools a programmer can wield. It allows developers to work efficiently and forget about the boilerplate. While some programmers scoff at the idea of using anything more than a text editor, when you are working on a very big project consisting of many files, an<a class="moretag" href="http://pythoncentral.org/the-best-python-ides-you-can-use-for-development/">&#160;&#160;Full Article&#8230;</a>
]]></description>
			<content:encoded><![CDATA[<p>An IDE (<em>Integrated Development Environment</em>) is one of the best tools a programmer can wield. It allows developers to work efficiently and forget about the boilerplate.</p>
<p>While some programmers scoff at the idea of using anything more than a text editor, when you are working on a very big project consisting of many files, an IDE will have features that will make your life as a developer much easier.</p>
<p>Some features you can expect a good IDE to have are:</p>
<ul>
<li>Code completion</li>
<li>Syntax highlighting</li>
<li>Templates for common code</li>
<li>Source Control support (<em>subversion, mercurial or git</em>)</li>
</ul>
<p>Let&#8217;s see which Python IDE&#8217;s are the best and how they stack up against each other.</p>
<div class="wp-caption aligncenter" style="width: 645px"><img class=" " src="http://i.imgur.com/raSRL.png" alt="Eclipse with PyDev" width="635" height="530" /><p class="wp-caption-text">Eclipse with PyDev</p></div>
<p><span id="more-51"></span></p>
<h1 id="section-1">Eclipse with PyDev</h1>
<div class="wp-caption aligncenter" style="width: 645px"><img src="http://i.imgur.com/EiAGC.png" alt="Eclipse with PyDev" width="635" height="530" /><p class="wp-caption-text">Eclipse with PyDev</p></div>
<p><strong>Official Site: <a href="http://pydev.org/">http://pydev.org/</a></strong></p>
<p>Eclipse is a very versatile IDE that&#8217;s been around for a very long time. It&#8217;s a time tested offering and is very solid all around. Eclipse is like a sandbox IDE; it can support any language as long as somebody has baked in the support through a package. Such is the case with PyDev, a package that allows you to turn Eclipse into a very useful Python IDE.</p>
<p>It&#8217;s a completely free IDE that offer a wide array of features such as:</p>
<ul>
<li>Django integration</li>
<li>Code completion</li>
<li>Code completion with auto import</li>
<li>Syntax highlighting</li>
<li>Code analysis</li>
<li>Go to definition</li>
<li>Refactoring</li>
<li>Mark occurrences</li>
<li>Debugger</li>
<li>Remote Debugger</li>
<li>Tokens browser</li>
<li>Interactive browser</li>
<li>Unit test integration</li>
<li>Code coverage</li>
<li>and many many more</li>
</ul>
<p>I use this when coding in Python on my Windows machine, it just works with minimal configuration.</p>
<h1 id="section-2">Komodo Edit</h1>
<div class="wp-caption aligncenter" style="width: 730px"><img src="http://i.imgur.com/nmai7.png" alt="Komodo Edit - Available in Windows, Linux and Mac." width="720" height="540" /><p class="wp-caption-text">Komodo Edit - Available in Windows, Linux and Mac.</p></div>
<p><strong>Official site: <a href="http://www.activestate.com/komodo-edit">http://www.activestate.com/komodo-edit</a></strong></p>
<p>Komodo Edit is a very clean, professional Python IDE. It doesn&#8217;t have fluff and instead focuses on putting the thing you need right in front of you. No digging through random submenus looking for an option. It&#8217;s code completion is very good and fast; it pops up as you type with minimal loading time.</p>
<p>ActiveState offers a commercial version of their IDE, called <a href="http://www.activestate.com/komodo-ide">Komodo IDE</a>.</p>
<p>The differences between the two version are as follows:</p>
<div class="wp-caption aligncenter" style="width: 730px"><img src="http://i.imgur.com/gYm5v.png" alt="Komodo Edit vs. Komodo IDE" width="720" height="441" /><p class="wp-caption-text">Komodo Edit vs. Komodo IDE</p></div>
<h1 id="section-3">PyCharm</h1>
<div class="wp-caption aligncenter" style="width: 665px"><img src="http://i.imgur.com/cuaSG.png" alt="PyCharm by JetBrains" width="655" height="351" /><p class="wp-caption-text">PyCharm by JetBrains</p></div>
<p>Official Site: <a href="http://www.jetbrains.com/pycharm/">http://www.jetbrains.com/pycharm/</a></p>
<p>PyCharm is an IDE created by <a href="http://www.jetbrains.com">JetBrains</a>. You might remember these guys as the authors of <a href="http://www.jetbrains.com/resharper/">ReSharper</a>, one of the best investments a .NET developer can make. Well PyCharm is no exception, and continuing with their outstanding pedigree, Jetbrains has released another excellent tool to the developer ecosystem.</p>
<p>Said to have the absolute best code completion technology, this one is worth at least a trial on your part.</p>
<ul>
<li>Cross Platfom</li>
<li>Commercial</li>
<li>Automatic Code-completion</li>
<li>Integrated Python Debugging</li>
<li>Error Markup</li>
<li>Source Control integration</li>
<li>Smart Indent</li>
<li>Bracket Matching</li>
<li>Line Numbering</li>
<li>Code Folding</li>
<li>Unit Testing</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://pythoncentral.org/the-best-python-ides-you-can-use-for-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

