<?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>Linux Candy &#187; python</title>
	<atom:link href="http://www.linuxcandy.com/category/linux-class/python/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linuxcandy.com</link>
	<description>The tasty side of Linux</description>
	<lastBuildDate>Tue, 21 May 2013 20:18:00 +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>Looping and Iterations in Python</title>
		<link>http://www.linuxcandy.com/2012/09/looping-and-iterations-in-python-2.html</link>
		<comments>http://www.linuxcandy.com/2012/09/looping-and-iterations-in-python-2.html#comments</comments>
		<pubDate>Mon, 24 Sep 2012 00:51:39 +0000</pubDate>
		<dc:creator>Mr Spark</dc:creator>
				<category><![CDATA[linux class]]></category>
		<category><![CDATA[linux tutorial]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[for]]></category>
		<category><![CDATA[iterations]]></category>
		<category><![CDATA[looping]]></category>
		<category><![CDATA[while]]></category>

		<guid isPermaLink="false">http://www.linuxcandy.com/?p=1790</guid>
		<description><![CDATA[Lets enter into the one of the most important topics in python: Looping. Looping or Iteration means repetition of a certain part of code for a number of times until a condition is met(till condition set of loops has true). First of these looping constructs is for: iterates through the items in the sequence, and [...]]]></description>
			<content:encoded><![CDATA[<p>Lets enter into the one of the most important topics in python: Looping. Looping or Iteration means repetition of a certain part of code for a number of times until a condition is met(till condition set of loops has <em>true</em>).</p>
<p>First of these looping constructs is <em>for</em>: iterates through the items in the sequence, and second is <em>while</em>: a general loop to be precise.</p>
<p><span style="text-decoration: underline;"><strong>The </strong></span><em><span style="text-decoration: underline;"><strong>for </strong></span></em><span style="text-decoration: underline;"><strong>loop:</strong></span></p>
<p><strong>Definition</strong>: <em>for</em> loop has an ability to iterate through the items present in the sequence, where a sequence can be a <em>list, tuple , etc</em>. and iterates until the condition set in the loop is <em>true. </em></p>
<p><strong>Syntax: </strong></p>
<pre><em>for</em> iterating_var <em>in</em> sequence:
   block of codes</pre>
<p>Each items present in the sequence is assigned to <em>iterating_var </em>and the block of codes present in the loop is executed until all the items in the sequence is used.</p>
<p><strong>Example 1):</strong></p>
<p>[python]<br />
&gt;&gt;&gt; for x in &#8216;Its W0rk!ng!?&#8217;:<br />
	print x</p>
<p>I<br />
t<br />
s</p>
<p>W<br />
0<br />
r<br />
k<br />
!<br />
n<br />
g<br />
!<br />
?<br />
[/python]</p>
<p>In the above example &#8216;Its W0rk!ng!?&#8217; is a sequence of characters: String to be exact. Each characters in the string is assigned to x and is printed with a newline characters by default.</p>
<p><strong>2)</strong></p>
<p>[python]<br />
&gt;&gt;&gt; scientist=['Einstein','Newton','Franklin','Darwin']<br />
&gt;&gt;&gt; for person in scientist:<br />
 print `person`</p>
<p>&#8216;Einstein&#8217;<br />
&#8216;Newton&#8217;<br />
&#8216;Franklin&#8217;<br />
&#8216;Darwin&#8217;<br />
[/python]</p>
<p>Here <em>scientist </em>is the list of names of few scientists, which are being assigned to <em>person</em> and printed until the list is exhausted.</p>
<p><span style="font-family: Times New Roman,serif;"><span style="font-size: medium;">Its time to introduce another function: </span></span><span style="font-family: Times New Roman,serif;"><span style="font-size: medium;"><em>range()</em></span></span></p>
<p><span style="font-family: Times New Roman,serif;"><span style="font-size: medium;">The </span></span><span style="font-family: Times New Roman,serif;"><span style="font-size: medium;">range</span></span><span style="font-family: Times New Roman,serif;"><span style="font-size: medium;"> function uses two arguments like this </span></span><span style="font-family: Times New Roman,serif;"><span style="font-size: medium;">range(start, finish)</span></span><span style="font-family: Times New Roman,serif;"><span style="font-size: medium;">. </span></span><span style="font-family: Times New Roman,serif;"><span style="font-size: medium;">start</span></span><span style="font-family: Times New Roman,serif;"><span style="font-size: medium;"> is the first number that is produced. </span></span><span style="font-family: Times New Roman,serif;"><span style="font-size: medium;">finish</span></span><span style="font-family: Times New Roman,serif;"><span style="font-size: medium;"> is one larger than the last number.</span></span></p>
<p>&gt;&gt;&gt; range(1,10) [1, 2, 3, 4, 5, 6, 7, 8, 9]</p>
<p><span style="font-family: Times New Roman,serif;"><strong>Example:</strong></span></p>
<p>[python]<br />
&gt;&gt;&gt; for x in range(1,10):<br />
	print x<br />
1<br />
2<br />
3<br />
4<br />
5<br />
6<br />
7<br />
8<br />
9<br />
[/python]</p>
<p><span style="font-family: Times New Roman,serif;"><span style="font-size: medium;">Here, x is assigned all the items present in the list ranging from 1 to 10 but excludes 10 in the execution and prints out the list.</span></span></p>
<p><span style="font-family: Times New Roman,serif;"><span style="font-size: small;"><br />
</span></span></p>
<p><span style="text-decoration: underline;"><strong>The <em>while</em> loop:</strong></span></p>
<p>A <em>while</em> statement repeatedly executes a block of code(indented one) till the expression at the top results into <em>true</em>. When the condition set in the expression becomes false, then the control passes to the statement the follows the <em>while </em>block.</p>
<p><strong>Syntax:<br />
</strong></p>
<pre>while expression:
   block of code</pre>
<p><strong>Example:</strong></p>
<p><strong>1)CODE:</strong></p>
<p>[python]<br />
count=0<br />
while (count&lt;10):<br />
    count = count +1<br />
    print count<br />
[/python]</p>
<p><strong>OUTPUT:</strong></p>
<p>[python]<br />
1<br />
2<br />
3<br />
4<br />
5<br />
6<br />
7<br />
8<br />
9<br />
10<br />
[/python]</p>
<p><strong>2)CODE:</strong></p>
<p>[python]<br />
string=['c','C++','Python','Scripting']<br />
index=0<br />
while (index &lt; len(string)):<br />
    print &#8216;I work on &#8216;+string[index]<br />
    index=index+1<br />
[/python]</p>
<p><strong>OUTPUT:</strong></p>
<p>[python]<br />
I work on c<br />
I work on C++<br />
&lt;pre&gt;I work on Python<br />
I work on Scripting<br />
[/python]</p>
<p><strong>3)</strong></p>
<p>[python]<br />
&gt;&gt;&gt; while True:<br />
	print(&#8216;Type Ctrl-C to stop me!&#8217;)<br />
[/python]</p>
<p><span style="text-decoration: underline;"><strong>LOOP controls</strong></span></p>
<p>After working on loops, we might have situation where have to exit a loop completely, skip statement and start with another. Here Python provides <strong>break </strong>and <strong>continue </strong>statement to achieve the above said.</p>
<p>In certain cases, where we have to choose which block of statements to execute at that time, we might need the help of <strong>else </strong>statements.</p>
<p><span style="text-decoration: underline;"><strong>The <em>break </em>statement:</strong></span></p>
<p>Using <em>break </em>statement, we can come out of the current loop and execute the next set of statements.</p>
<p><em>break </em>statement are used mostly in <em>for </em>and <em>while </em>loops.</p>
<p><strong>Example:</strong></p>
<p><strong>CODE:</strong></p>
<p>[python]<br />
while True:<br />
    menu=input(&quot;\nMENU:\n1.NAME\n2.EXIT\nEnter a number:&quot;)<br />
    if menu==1 :<br />
        name=raw_input(&#8216;Enter your name:&#8217;)<br />
        pro=raw_input(&#8216;Enter which Language you work on:&#8217;)<br />
        print &#8216;Welcome, &#8216;+name+&#8217; . You work on &#8216; + pro+&#8217; !! Nice <img src='http://www.linuxcandy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> &#8217;<br />
    else:<br />
        break<br />
print &#8216;Your are out of loop now!!&#8217;<br />
[/python]</p>
<p><strong>OUTPUT:</strong></p>
<p>[python]<br />
MENU:<br />
1.NAME<br />
2.EXIT<br />
Enter a number:1<br />
Enter your name:Mr.Spark<br />
Enter which Language you work on:Python<br />
Welcome, Mr.Spark . You work on Python !! Nice <img src='http://www.linuxcandy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>MENU:<br />
1.NAME<br />
2.EXIT<br />
Enter a number:1<br />
Enter your name:Cemicolon<br />
Enter which Language you work on:Python and C<br />
Welcome, Cemicolon . You work on Python and C !! Nice <img src='http://www.linuxcandy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>MENU:<br />
1.NAME<br />
2.EXIT<br />
Enter a number:2<br />
Your are out of loop now!!<br />
[/python]</p>
<p><span style="text-decoration: underline;"><strong>The continue statement:</strong></span></p>
<p>The <em>continue </em>statement transfers the control to the beginning of the loop and skips all the statements under it, of the current iteration of the loop.</p>
<p><strong>Example:</strong></p>
<p><strong>CODE:</strong></p>
<p>[python]<br />
for letter in &lt;strong&gt;&#8217;Python&#8217;&lt;/strong&gt;:     # First Example<br />
   if letter == &#8216;h&#8217;:<br />
      continue<br />
   print &#8216;Current Letter :&#8217;, letter<br />
[/python]</p>
<p><strong>OUTPUT:</strong></p>
<p>[python]<br />
Current Letter : P<br />
Current Letter : y<br />
Current Letter : t<br />
Current Letter : o<br />
Current Letter : n<br />
[/python]</p>
<p><span style="text-decoration: underline;"><strong>The <em>pass </em>Statement:</strong></span></p>
<p>The <em>pass</em> statement is null operational statement, which does nothing. We get situation where syntactically some code must be placed, but at that moment you have nothing to put here a <em>pass</em> statement is used to do nothing.</p>
<p><strong>Example:</strong></p>
<p><strong>CODE:</strong></p>
<p>[python]<br />
for letter in &lt;strong&gt;&#8217;Python&#8217;&lt;/strong&gt;:<br />
   if letter == &#8216;h&#8217;:<br />
      &lt;strong&gt;pass&lt;/strong&gt;<br />
      print &#8216;This is pass block&#8217;<br />
   print &#8216;Current Letter :&#8217;, letter<br />
[/python]</p>
<p><strong>OUTPUT:</strong></p>
<p>[python]<br />
Current Letter : P<br />
Current Letter : y<br />
Current Letter : t<br />
This is pass block<br />
Current Letter : h<br />
Current Letter : o<br />
Current Letter : n<br />
[/python]</p>
<p><span style="text-decoration: underline;"><strong>The <em>else</em> Statement Used with Loops</strong></span></p>
<p>This <em>else </em>statement functions same while it was used in <em>if</em> clause, but with few changes on how it is executed.</p>
<p><em>for </em>loop: If the <strong>else</strong> statement is used with a <strong>for</strong> loop, the <strong>else</strong> statement is executed when the loop has exhausted iterating the list.<br />
w<em>hile </em>loop: If the <strong>else</strong> statement is used with a <strong>while</strong> loop, the <strong>else</strong> statement is executed when the condition becomes false.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxcandy.com/2012/09/looping-and-iterations-in-python-2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python: Conditional Constructs:if-else..</title>
		<link>http://www.linuxcandy.com/2012/09/python-conditional-constructsif-else.html</link>
		<comments>http://www.linuxcandy.com/2012/09/python-conditional-constructsif-else.html#comments</comments>
		<pubDate>Sun, 09 Sep 2012 19:22:26 +0000</pubDate>
		<dc:creator>Mr Spark</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux class]]></category>
		<category><![CDATA[linux tutorial]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.linuxcandy.com/?p=1746</guid>
		<description><![CDATA[We have completed very basic of Python til now. In some situations depending on the conditions the set of codes will be executed. In python, we have conditional constructs which will help us program more efficiently. Conditions: We have few conditional operators in python, which will help us in comparing two values and give the [...]]]></description>
			<content:encoded><![CDATA[<p>We have completed very basic of Python til now. In some situations depending on the conditions the set of codes will be executed. In python, we have conditional constructs which will help us program more efficiently.</p>
<h1></h1>
<h1><strong>Conditions:</strong></h1>
<p>We have few conditional operators in python, which will help us in comparing two values and give the result in Boolean value(<em>True</em> or <em>False</em>).</p>
<p><a href="../wp-content/uploads/2012/09/1.png"><span style="color: #000080"><img src="../wp-content/uploads/2012/09/1.png" alt="" width="348" height="246" align="BOTTOM" border="1" /></span></a></p>
<p>Enter the following code in terminal to see the results:</p>
<p>[python]<br />
&gt;&gt;&gt; 1&gt;4<br />
False<br />
&gt;&gt;&gt; 5&gt;3<br />
True<br />
&gt;&gt;&gt; 1==1<br />
True<br />
&gt;&gt;&gt; 1=1<br />
SyntaxError: can&#8217;t assign to literal<br />
&gt;&gt;&gt; 9!=8<br />
True<br />
&gt;&gt;&gt; 100&gt;=1212121<br />
False<br />
[/python]</p>
<p>NOTE:We cant use assignment operator(=) because its used for storing value in variable, so we use == operator(<em>double equal symbol</em>) for Equality comparison.</p>
<p>Similarly, we can use comparison operator on Strings.</p>
<p>[python]<br />
&gt;&gt;&gt; &#8216;Mr.Spark&#8217; == &quot;Mr.Spark&quot;<br />
True<br />
&gt;&gt;&gt; &#8216;Mr.Spark&#8217; &lt; &#8216;cemicolon&#8217;                                   #ASCII code of c(99) &gt; M(77)<br />
True<br />
&gt;&gt;&gt;”PYTHON” ==”python”<br />
False<br />
[/python]</p>
<p>That was something about the comparison operator, lets move onto something more interesting: conditional constructs. Using Conditional Constructs, we can control the flow of the program.</p>
<p>The various Conditional constructs are if, if&#8230;else, elif, and nested if.</p>
<h2><span style="text-decoration: underline">The </span><strong><span style="text-decoration: underline">if</span></strong><span style="text-decoration: underline"> Statement</span></h2>
<p>The <em>if</em> statement contains a logical expression with which the data will be compared, if the condition is evaluated successfully then it will execute a certain a block of code or else if the condition is false then it will not execute the block of code.</p>
<p><strong>Syntax:<br />
</strong>if <em>expression</em>:<br />
#Block of code</p>
<p>Note: We know that Python uses <em>indentation </em>to group certain part of code. When any Conditional construct is met, the following code will be automatically indented.</p>
<p><strong>Example:</strong></p>
<p>[python]<br />
 #!/ur/bin/env python<br />
var_if=raw_input(&quot;Enter true to test if its working:&quot;)<br />
 if var_if==&#8217;true&#8217;:<br />
      print &quot;Its working!!&quot;<br />
 [/python]</p>
<p>Output:</p>
<p>[python]<br />
&gt;&gt;&gt; Enter true to test if its working:true<br />
Its working!!<br />
[/python]</p>
<h2><span style="text-decoration: underline">The </span><em><span style="text-decoration: underline">Else </span></em><span style="text-decoration: underline">Statement:</span></h2>
<p><em>Else</em> is used in combination with <em>if</em> Statement. If the <em>if </em>statement condition fails(resolves to 0 or <em>false </em>value) then it executes the block of code following the <em>else</em> statement. This is Optional instruction.</p>
<pre>if expression:
   #block of statement if value is true
else:
   #block of statement if value is false</pre>
<p>In the previous example, we don&#8217;t have anything to execute in case &lt;em&gt;if&lt;/em&gt; statement so lets modify the code here.</p>
<p><strong>Example:</strong></p>
<p>[python]<br />
#!/ur/bin/env python</p>
<p>var_if=raw_input(&quot;Enter true to test if its working:&quot;)<br />
 if var_if==&#8217;true&#8217;:<br />
     print &quot;Its working!!&quot;<br />
 else:<br />
     print &quot;Resulted into False,Still working&quot;<br />
 [/python]</p>
<p><strong>Output:</strong><br />
[python]<br />
&gt;&gt;&gt; Enter true to test if its working:false<br />
Resulted into False,Still working<br />
[/python]</p>
<h2>The <em>elif </em>statement:</h2>
<p>We have situation when we have multiple comparison to make, for that we use <em>elif </em>statement. Lets put it technically, <em>elif</em> statement allows you to check multiple expressions for truth value and execute a block of code as soon as one of the conditions evaluates to true. Like <em>else,elif</em> is also an optional statement.</p>
<p><strong>Syntax:</strong></p>
<pre>if expression1:
   #Block of code
elif expression2:
   #Block of code
elif expression3:
   #Block of code
else:
  #Block of code</pre>
<p><strong>Example:</strong></p>
<p>[python]#<br />
!/ur/bin/env python<br />
# -*- coding: utf-8 -*-<br />
_if=raw_input(&quot;To know Creator\nMenu\n1.Python\n2.C++\n3.Ruby\nEnter number:&quot;)<br />
if var_if==&#8217;1&#8242;:<br />
    print &quot;Guido Van Rossum&quot;<br />
lif var_if==&#8217;2&#8242;:<br />
    print &quot;Bjarne Stroustrup&quot;<br />
elif var_if==&#8217;3&#8242;:<br />
    print &quot;Yukihiro “matz” Matsumoto&quot;<br />
else:<br />
    print &#8216;Wrong value exiting!!&#8217;<br />
exit()<br />
[/python]</p>
<p><strong><br />
Output:</strong></p>
<p>[python]<br />
To know Creator<br />
Menu<br />
1.Python<br />
2.C++<br />
3.Ruby<br />
Enter number:2<br />
Bjarne Stroustrup<br />
[/python]</p>
<h2><span style="text-decoration: underline"><br />
The Nested if..elif..else construct</span></h2>
<p>There will be situation where we want to check for another condition when it the condition results to <em>true</em>.</p>
<p><strong>Syntax:</strong></p>
<pre>if expression1:
   #Block of code
   <strong>if expression2:</strong>
      <strong>#Block of code</strong>
   <strong>elif expression3:</strong>
      <strong>#Block of code</strong>
   <strong>else</strong>
      <strong>#Block of code</strong>
elif expression4:
   #Block of code
else:
   #Block of code</pre>
<p><strong>Example:</strong></p>
<p>[python]<br />
#!/ur/bin/env python<br />
food=raw_input(&#8216;Burger or Meals?&#8217;)<br />
if food==&quot;Burger&quot;:<br />
    burger=raw_input(&#8216;Veg or Non veg&#8217;)<br />
if burger==&#8217;veg&#8217;:<br />
    print &#8216;Costs 40rs!!&#8217;<br />
else:<br />
    print &quot;Costs 50rs&quot;<br />
elif food==&quot;Meals&quot;:<br />
    meals=raw_input(&#8217;1.North Indian\n2.South Indian\n3.Chinese&#8217;)<br />
if meals==&#8217;1&#8242;:<br />
    print &#8216;Costs 70rs&#8217;<br />
elif meals==&#8217;2&#8242;:<br />
    print &#8216;Costs 80rs&#8217;<br />
else:<br />
    print &#8216;Costs 75rs&#8217;<br />
else:<br />
    print &#8216;Do nothing&#8217;<br />
[/python]</p>
<p><strong>Output:</strong></p>
<p>[python]<br />
&gt;&gt;&gt;<br />
Burger or Meals?&lt;em&gt;Meals&lt;/em&gt;<br />
1.North Indian<br />
2.South Indian<br />
3.Chinese&lt;em&gt;2&lt;/em&gt;<br />
Costs 80rs<br />
[/python]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxcandy.com/2012/09/python-conditional-constructsif-else.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>String Enters the Arena</title>
		<link>http://www.linuxcandy.com/2012/08/string-enters-the-arena.html</link>
		<comments>http://www.linuxcandy.com/2012/08/string-enters-the-arena.html#comments</comments>
		<pubDate>Fri, 03 Aug 2012 06:37:24 +0000</pubDate>
		<dc:creator>Mr Spark</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux class]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[examples]]></category>
		<category><![CDATA[python tutorial]]></category>
		<category><![CDATA[string in python]]></category>
		<category><![CDATA[strings]]></category>

		<guid isPermaLink="false">http://www.linuxcandy.com/?p=1614</guid>
		<description><![CDATA[The next Superpower of Python which we are going to study is “Strings”- a text based information which is a collection of ordered collection of characters. In this Blog we are going to discuss on how to store text in variables, concatenation,use text as expressions and many more. Lets begin our tour. Strings Strings are [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center">
<p><img src="http://www.arungeek.com/wp-content/uploads/2012/06/Python-Programming-Language.png" alt="" width="721" height="244" align="BOTTOM" border="0" /></p>
<p>The next Superpower of Python which we are going to study is “Strings”- a text based information which is a collection of ordered collection of characters. In this Blog we are going to discuss on how to store text in variables, concatenation,use text as expressions and many more. Lets begin our tour.</p>
<h1><strong>Strings</strong></h1>
<p><em>Strings </em>are little chunks of <em>text </em>which can be used to store it in a variable, display it and has many other purposes.We have used strings in many languages but Python&#8217;s strings has some special properties like there is no distinct type of characters in strings, instead we just use one character strings. Another main property of Strings in Python is their<span style="color: #800000"> immutable</span> property, which means characters are placed in ordered fashion from left to right.</p>
<p>Working with strings is sort of easy, we face difficulty when we have to write them in code, because there are many ways in which a string can be written.</p>
<ol>
<li>Single Quotes: &#8216;Python”s&#8217;</li>
<li>Double Quotes: ”Python&#8217;s”</li>
<li>Escape Sequences: “P\ty\ntho\ons”</li>
</ol>
<p>and there others also like Triple quotes,Byte strings, Unicode Strings and Raw strings, but at beginner level it will be enough to know the first 3 types mentioned in points.</p>
<p>→ The quotes are there only to tell the computer where the string begins and ends</p>
<p>(and is not part of the string value).</p>
<p>→ There&#8217;s not much difference in Single quotes and Double Quotes usage, both are same actually. The Reason for supporting both is that it will allow one to write a quote character of other type without the usage of backslash. It will be clear from the code given:</p>
<p>Code:</p>
<pre>&gt;&gt;&gt; string=”Monty Python's”
&gt;&gt;&gt; string
“Monty Python's”
&gt;&gt;&gt; string='Monty Python”s'
&gt;&gt;&gt; string
'Monty Python”s'
&gt;&gt;&gt; string="hello"s"
SyntaxError: invalid syntax
&gt;&gt;&gt; string='python's'
SyntaxError: invalid syntax</pre>
<h2><strong>String Concatenation</strong></h2>
<p>We can combine one string with other string, which is called String concatenation. We can do this using &#8216;+&#8217; operator or by using Space Character.</p>
<pre>&gt;&gt;&gt; var="Guido " + "van" + " Rossum"
&gt;&gt;&gt; var
'Guido van Rossum'
&gt;&gt;&gt; var="Guido " "van" " Rossum"
&gt;&gt;&gt; var
'Guido van Rossum'</pre>
<p>→When using comma instead of the concatenation operator between the strings, we will get Tuple not a string.</p>
<pre>&gt;&gt;&gt; var = "string1,string2"
&gt;&gt;&gt; var
'string1,string2'</pre>
<p>Note: Strings and Integers are different Datatype.</p>
<pre>&gt;&gt;&gt; var= "hello "+ 5
Traceback (most recent call last):
File "&lt;pyshell#18&gt;", line 1, in &lt;module&gt;
var= "hello "+ 5
TypeError: cannot concatenate 'str' and 'int' objects</pre>
<p>This error came because we tried to concatenate String and Integer Objects.</p>
<h2><strong>Strings in Action</strong></h2>
<p>Since we have gained some knowledge of string literals, lets work on this. This part of blog will demonstrate String expressions , methods and formatting.</p>
<p>We have seen how to concatenate two strings, now lets see how strings can be repeated using * operator.</p>
<pre>&gt;&gt;&gt; var= 'ha' * 6
&gt;&gt;&gt; print var
hahahahahaha #repetition of 'ha' 6 times</pre>
<p>similarly, we can find the length of the strings or other objects which has a length.</p>
<pre>&gt;&gt;&gt; len(var)
12
&gt;&gt;&gt; len(var * 6)
72
&gt;&gt;&gt; len ('abc'+"def")
6</pre>
<p>Repetition comes handy in many applications, consider a case where you want to enter &#8216; &#8211; &#8216; 120 times for the end of a diary.</p>
<pre>&gt;&gt;&gt; endline='-' * 120
&gt;&gt;&gt; print endline
------------------------------------------------------------------------------------------------</pre>
<p>Its better than to write 120 <em>dashes</em>.</p>
<h2><strong>String Conversion tool</strong></h2>
<p><strong><img src="../wp-content/uploads/2012/08/conversion.jpeg" alt="" width="225" height="225" align="BOTTOM" border="0" /></strong></p>
<p>In some situation, lets take concatenation as an example, when u want to concatenate string and integer we get an error because both the data type is different. We can overcome from this problem by conversion.</p>
<pre>&gt;&gt;&gt; 'abc'+123
Traceback (most recent call last):
File "&lt;pyshell#37&gt;", line 1, in &lt;module&gt;
'abc'+123
TypeError: cannot concatenate 'str' and 'int' objects
&gt;&gt;&gt;'abc'+str(123)
'abc123'
&gt;&gt;&gt; int('123')+321
444
&gt;&gt;&gt; repr(24)
'24'</pre>
<p>The <em>str</em> function converts a integer into a string, while <em>int </em>function converts a string into an integer and <em>repr</em> funtions similar to <em>str</em> that it converts an object into string.</p>
<pre>&gt;&gt;&gt; str(123),repr(123)
('123', '123')
&gt;&gt;&gt; str('abc'),repr('abc')
('abc', "'abc'")</pre>
<p><em>In my next blog, we will be discussing on slicing and indexing which acts as an array function in python and then will move onto how we can change the strings, joining a string and finally will discuss on string as expression.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxcandy.com/2012/08/string-enters-the-arena.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Save and Run Python Program in IDLE</title>
		<link>http://www.linuxcandy.com/2012/07/how-to-save-and-run-python-program-in-idle.html</link>
		<comments>http://www.linuxcandy.com/2012/07/how-to-save-and-run-python-program-in-idle.html#comments</comments>
		<pubDate>Mon, 30 Jul 2012 14:31:28 +0000</pubDate>
		<dc:creator>Mr Spark</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux class]]></category>
		<category><![CDATA[linux tutorial]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[idle]]></category>
		<category><![CDATA[run]]></category>
		<category><![CDATA[run python program in idle]]></category>
		<category><![CDATA[save]]></category>

		<guid isPermaLink="false">http://www.linuxcandy.com/?p=1569</guid>
		<description><![CDATA[Some of us might not know how to work with IDLE. so let me quickly through how to deal with IDLE saving of program and executing them. Hope you have by now IDLE installed in your system. If not please do it. After having installed it will look like this, In Windows we are working [...]]]></description>
			<content:encoded><![CDATA[<p><strong><em>Some of us might not know how to work with IDLE. so let me quickly through how to deal with IDLE saving of program and executing them. Hope you have by now IDLE installed in your system. If not please do it.</em></strong></p>
<p><img class="alignnone" src="http://hacks8santosh.files.wordpress.com/2012/06/p1.png?w=529&amp;h=158" alt="python graphical shell" width="529" height="158" /></p>
<p>After having installed it will look like this,</p>
<p><img src="http://hacks8santosh.files.wordpress.com/2012/06/p22.png?w=529&amp;h=163" alt="" width="529" height="163" /></p>
<p>In <em><strong>Windows</strong></em> we are working on IDLE, so they need not do anything special.</p>
<p>In IDLE, goto <em><strong>File → New Window. </strong></em>This is where we will be writing the code,execute and saving them, its just like a notepad. Lets write a small code to begin with</p>
<p>[python]<br />
print “Hello world”<br />
[/python]</p>
<p><a href="http://hacks8santosh.files.wordpress.com/2012/06/p32.png"><img src="http://hacks8santosh.files.wordpress.com/2012/06/p32.png?w=529&amp;h=120" alt="print “Hello world”" width="529" height="120" /></a></p>
<p>Go to <em><strong>R</strong></em><em><strong>u</strong></em><em><strong>n</strong></em><em><strong> </strong></em><em><strong>→ Run Module </strong></em>or you can press <strong>F5</strong>, then we have the output to the IDLE interface as shown in the figure:</p>
<p><a href="http://hacks8santosh.files.wordpress.com/2012/06/p41.png"><img src="http://hacks8santosh.files.wordpress.com/2012/06/p41.png?w=529&amp;h=174" alt="" width="529" height="174" /></a></p>
<p>Lets make it more interesting by writing the code:</p>
<p>[python]<br />
x=raw_input(“Enter your name:”)<br />
print “Welcome,”+x<br />
[/python]</p>
<p><a href="http://hacks8santosh.files.wordpress.com/2012/06/p5.png"><img src="http://hacks8santosh.files.wordpress.com/2012/06/p5.png?w=529&amp;h=126" alt="" width="529" height="126" /></a></p>
<p>run the module(<span style="color: #800000;">F5</span>), we have</p>
<p><img src="http://hacks8santosh.files.wordpress.com/2012/06/p61.png?w=529&amp;h=196" alt="" width="529" height="196" /></p>
<p>That’s it about saving the program guys, but this is not the end we have a python file saved in a specific destination, Let’s check that out. When you open that file we have a problem, <span style="color: #000080;"><em>Whats that???</em></span> After typing in the name we can’t see what has happened.</p>
<p>Note to <em><strong>Linux</strong></em> user,</p>
<p>You need to put this following line in your python script:</p>
<p>[python]<br />
#!/usr/bin/env python<br />
[/python]</p>
<p>which means the script will execute with the help of env python in usr/bin directory. and another important thing you cannot directly execute the file which is located in a location specified, because the file is not <em><strong>executable. </strong></em>So,type in the terminal</p>
<pre><span style="color: #003300;">v$chmod 700 p1.py</span></pre>
<p>which makes the file executable. When we run in terminal, the problem is same we can’t see the output. Change the code in the python file, p1.py as</p>
<p>[python]<br />
x=raw_input(“Enter your name:”)<br />
print “Welcome,”+x<br />
raw_input(“Press&lt;Enter&gt;”)<br />
[/python]</p>
<p>Just the save the file here and run it.</p>
<p>&nbsp;</p>
<p>[python]</p>
<p>thor@war:~$ ls<br />
Desktop  Documents  Downloads  examples.desktop  pl.py<br />
thor@war:~$ chmod 700 pl.py<br />
thor@war:~$ python pl.py<br />
hello<br />
Enter your name:chandan<br />
Welcome, chandan<br />
thor@war:~$ ls<br />
Desktop  Documents  Downloads  examples.desktop  pl.py<br />
thor@war:~$<br />
[/python]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxcandy.com/2012/07/how-to-save-and-run-python-program-in-idle.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working with Functions and modules in Python</title>
		<link>http://www.linuxcandy.com/2012/07/working-with-functions-and-modules-in-python.html</link>
		<comments>http://www.linuxcandy.com/2012/07/working-with-functions-and-modules-in-python.html#comments</comments>
		<pubDate>Tue, 24 Jul 2012 14:05:35 +0000</pubDate>
		<dc:creator>Mr Spark</dc:creator>
				<category><![CDATA[linux class]]></category>
		<category><![CDATA[linux tutorial]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[modules]]></category>

		<guid isPermaLink="false">http://www.linuxcandy.com/?p=1515</guid>
		<description><![CDATA[Sandesh Yadav LinuxCandy mentioned. &#160; A function is a block of code that performs a specific action and returns a result. How functions make your life easier? Functions let you write code only once. The decrease in the unnecessary complexity from the user. In my last blog I discussed about exponents as a function. i.e, [...]]]></description>
			<content:encoded><![CDATA[<div class="fb-mentions entry-meta"><a href="http://www.facebook.com/1166626200" title="Click to visit Sandesh Yadav&#039;s profile on Facebook."><img src="http://graph.facebook.com/1166626200/picture" width="16" height="16"> Sandesh Yadav</a> <a href="http://www.facebook.com/259031487463784" title="Click to visit LinuxCandy&#039;s profile on Facebook."><img src="http://graph.facebook.com/259031487463784/picture" width="16" height="16"> LinuxCandy</a> mentioned.</div><p><a href="http://www.linuxcandy.com/wp-content/uploads/2012/07/python-icon.jpg"><img class="aligncenter size-full wp-image-1550" title="python-icon" src="http://www.linuxcandy.com/wp-content/uploads/2012/07/python-icon.jpg" alt="" width="230" height="228" /></a></p>
<p>&nbsp;</p>
<p>A<span style="color: #993300;"> <strong>function</strong></span> is a block of code that performs a specific action and returns a result.</p>
<p><span style="color: #800000;"><em>How functions make your life easier?</em></span></p>
<ul>
<li><em>Functions let you write code only once.</em></li>
</ul>
<ul>
<li><em>The decrease in the unnecessary complexity from the user. In my last blog I discussed about exponents as a function. i.e,</em></li>
</ul>
<p>[python]<br />
&gt;&gt;&gt;5**4<br />
625<br />
[/python]</p>
<p>this can also be done by a function . How we do that is by first writing the function name followed by the parameters the function would need. A parameter is pretty much like what a function will need to do a task. So taking the above data only,we have</p>
<p>[python]<br />
&gt;&gt;&gt;pow(5,4)<br />
625<br />
[/python]</p>
<p>likewise, there are others like <span style="color: #000080;"><em>abs</em>()</span> for absolute and all.</p>
<p>Apart from functions, we have similar functionality called a Module. A Module is a text file which stores the python codes, in other words in makes the collection of similar type of tools in it and is organised in a particular manner. We can make a module available to another program by just importing it, please note here that import is a keyword.<br />
<span style="color: #0000ff;"><em>Syntax</em></span>: import<span style="color: #333399;"> <em>module_name</em></span><br />
Say for example we want to use a function floor()  which rounds up the variable</p>
<p>[python]<br />
&gt;&gt;&gt;floor(18.34534)<br />
Traceback (most recent call last):<br />
File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;<br />
NameError: name &#8216;root&#8217; is not defined<br />
[/python]</p>
<p>we get an error message. Well this is because we didn’t import the function <em>floor</em>(), python will not understand this and will raise a question, which we call it as an error. So what we need to do is import the tools of <em>math</em>, please note here that <em>math</em>  is a module . So, to access a function via module we have,<br />
<em>Syntax</em>: module_name.function_name</p>
<p>[python]<br />
&gt;&gt;&gt;import math<br />
&gt;&gt;&gt;math.floor(18.34534)<br />
18.0<br />
[/python]</p>
<p>similarly, for using the value of pi</p>
<p>[python]<br />
&gt;&gt;&gt;math.pi<br />
3.1415926535897931<br />
[/python]</p>
<p>In short, import is actually expanding the content of a file which will result into more tools for a user.</p>
<p>Lets go the Lazy way, this is what I call for the shortcut. If we have long module name and function name it will be hectic to call them all the time so what we do is assign it to the variable. Consider the following example you will understand then,</p>
<p>[python]<br />
&gt;&gt;&gt; variable=math.pi<br />
&gt;&gt;&gt; variable+7<br />
10.141592653589793<br />
&gt;&gt;&gt; variable=math.sqrt<br />
&gt;&gt;&gt;variable(9)<br />
3.0<br />
    [/python]</p>
<p>That’s it about the functions and modules, in my next blog I’ll be discussing on how to save your program and strings</p>
<div class="fb-mentions entry-meta"><a href="http://www.facebook.com/1166626200" title="Click to visit Sandesh Yadav&#039;s profile on Facebook."><img src="http://graph.facebook.com/1166626200/picture" width="16" height="16"> Sandesh Yadav</a> <a href="http://www.facebook.com/259031487463784" title="Click to visit LinuxCandy&#039;s profile on Facebook."><img src="http://graph.facebook.com/259031487463784/picture" width="16" height="16"> LinuxCandy</a> mentioned.</div>]]></content:encoded>
			<wfw:commentRss>http://www.linuxcandy.com/2012/07/working-with-functions-and-modules-in-python.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Which Python IDE is best ? Choose your own!</title>
		<link>http://www.linuxcandy.com/2012/07/which-python-ide-is-best-choose-your-own.html</link>
		<comments>http://www.linuxcandy.com/2012/07/which-python-ide-is-best-choose-your-own.html#comments</comments>
		<pubDate>Mon, 16 Jul 2012 07:24:38 +0000</pubDate>
		<dc:creator>Mr Spark</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux class]]></category>
		<category><![CDATA[linux tutorial]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[best python ide]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python ide]]></category>
		<category><![CDATA[python text editor]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.linuxcandy.com/?p=1422</guid>
		<description><![CDATA[Before we move onto writing programs in Python, we will be needing an Editor to write the source files. But many of us will be having a confusion here, whether to choose an IDE or a Text editor. With dozens of fancy editors and IDEs out there for the beginners probably its nightmare to select and stick to [...]]]></description>
			<content:encoded><![CDATA[<p align="LEFT"><a href="http://www.linuxcandy.com/wp-content/uploads/2012/07/pythonw.jpg"><img class="aligncenter size-full wp-image-1438" src="http://www.linuxcandy.com/wp-content/uploads/2012/07/pythonw.jpg" alt="" width="573" height="308" /></a></p>
<p align="LEFT"><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">Before we move onto writing programs in Python, we will be needing an Editor to write the source files. But many of us will be having a confusion here, whether to choose an </span></span></span><strong><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">IDE</span></span></span></strong><em><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small"> </span></span></span></em><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">or a </span></span></span><strong><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">Text editor</span></span></span></strong><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">. With dozens of fancy editors and IDEs out there for the beginners probably its nightmare to select and stick to one where one of your friend suggests you to use vim and other says don&#8217;t get your head banging with vim or emacs go for simple GUI&#8217;s like IDLE. Not only choosing IDE or text editor is a big decision to make but customizing it to your need is another important step to take after you have chosen of them. Now lets us look at available IDE&#8217;s and text editors which are mostly used here. By the end of the post you might be, well you should be able to decide which one you are going to stick with. </span></span></span></p>
<p align="LEFT"><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">Well, a </span></span></span><strong><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">Text editor</span></span></span></strong><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small"> can be used to create and edit text files. There are few text editor which are specifically built for writing programming languages that has some special features like </span></span></span><a href="http://en.wikipedia.org/wiki/Syntax_highlighting"><span style="color: #004a8d"><span style="font-family: Ubuntu"><span style="font-size: small">Syntax highlighting</span></span></span></a><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small"> , automatic editing and Compilation and Execution Commands.</span></span></span></p>
<p align="LEFT"><strong><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">IDE</span></span></span></strong><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small"> stands for </span></span></span><em><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">Integrated Development Environment,</span></span></span></em><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small"> they have mostly all the features of a Text Editor. The idea behind an IDE is to encompass everything a Python programmer could want to do in one application. Theoretically it should allow them to develop Python programs faster. A IDE contains many features like:</span></span></span></p>
<ol>
<li>
<p align="LEFT"><span style="color: #993300"><em><span style="font-family: Ubuntu"><span style="font-size: small"><span style="text-decoration: underline">Automatic code completion</span></span></span></em></span><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">: while typing any Python code, the IDE will give a list to chose from which will make the work easier if the code has to be repeated.</span></span></span></p>
</li>
<li>
<p align="LEFT"><span style="color: #993300"><em><a href="http://en.wikipedia.org/wiki/GUI_Builder"><span style="color: #993300"><span style="font-family: Ubuntu"><span style="font-size: small"><span style="text-decoration: underline">GUI Builder</span></span></span></span></a></em></span></p>
</li>
<li>
<p align="LEFT"><span style="color: #993300"><em><span style="font-family: Ubuntu"><span style="font-size: small"><span style="text-decoration: underline">Optimization</span></span></span></em></span><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small"><span style="color: #993300">:</span> While developing python codes the complexity may increase, IDE may help in increasing the speed and efficiency.</span></span></span></p>
</li>
</ol>
<p align="LEFT"><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">and many more. When you get to the point where you need to juggle dozens of source files and link them together, that’s when I recommend an IDE.</span></span></span></p>
<p align="LEFT"><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">So let me list the most used, more user friendly and the best of IDE’s and Text editors.</span></span></span></p>
<h2 align="LEFT"><span style="color: #333399"><strong><span style="font-family: Ubuntu"><span style="font-size: large">IDE(Integrated Development Environment)</span></span></strong></span></h2>
<p align="LEFT"><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">When asks for which is the best IDE for Python, there may be many questions which will pop-up.</span></span></span></p>
<blockquote><p><span style="color: #800000"><span style="font-family: Ubuntu"><span style="font-size: small"><em>What OS? Your definition of an “IDE”? Do you just want an editing environment with say class browsing capabilities or do you want an integrated debugger and such? And many more may be…</em></span></span></span></p></blockquote>
<p align="LEFT"><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">I have prepared a list of IDE’s which has unique properties from other:</span></span></span></p>
<h4 align="LEFT"><span style="color: #222222"><span style="font-family: Ubuntu"><span style="font-size: small">1.<span style="color: #000080">Stani’s Python editor</span></span></span></span></h4>
<p align="LEFT"><span style="color: #333333">→ <span style="font-family: Ubuntu"><span style="font-size: small">Stani’s Python editor (SPE) named after the IDE’s author. SPE is another free IDE written in Python, and it requires at least Python 2.6 to run, which is the version of Python I’ll be working on.</span></span></span></p>
<p align="LEFT"><span style="color: #333333">→ <span style="font-family: Ubuntu"><span style="font-size: small">In windows, It cannot be started as such from the Start menu, it has to invoked from command line.</span></span></span></p>
<p align="LEFT"><span style="color: #333333">→ </span><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">The SPE editor includes </span></span></span><em><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">code completion</span></span></span></em><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">, </span></span></span><em><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">call tips</span></span></span></em><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small"> and </span></span></span><em><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">compile checking</span></span></span></em><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">, compile checking is optional.</span></span></span></p>
<p align="LEFT"><span style="color: #333333">→ </span><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">One of SPE’s unique features is its ability to integrate with Blender, the free, commercial-grade graphical rendering and animation system. (It would be impossible to adequately describe Blender in this small space, see the </span></span></span><a href="http://www.blender.org/" target="_blank"><span style="color: #004a8d"><span style="font-family: Ubuntu"><span style="font-size: small">Blender website</span></span></span></a><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small"> for more info.) You can actually run SPE inside Blender, which can be scripted with Python.</span></span></span></p>
<p align="LEFT"><span style="color: #333333">→</span><span style="color: #800000"> </span><span style="color: #800000"><span style="font-family: Ubuntu"><span style="font-size: small">Website:</span></span></span><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small"> </span></span></span><a href="http://pythonide.blogspot.in/"><span style="color: #004a8d"><span style="font-family: Ubuntu"><span style="font-size: small">http://pythonide.blogspot.in/</span></span></span></a></p>
<p align="LEFT"><span style="color: #333333"><img src="http://images.six.betanews.com/screenshots/1129853364-1.png" alt="" width="460" height="368" align="BOTTOM" border="0" vspace="10" /></span></p>
<h4 align="LEFT"><span style="color: #222222"><span style="font-family: Ubuntu"><span style="font-size: small">2.<span style="color: #000080">Komodo Edit:</span></span></span></span></h4>
<p align="LEFT"><span style="color: #333333">→ <span style="font-family: Ubuntu"><span style="font-size: small">Komodo Edit, a text editor developed by <span style="color: #800000">ActiveState</span>, is a powerful text based editor that so happens to be <span style="color: #008000">free and open source</span>. This cross platform, Python based text editor is available for use on <span style="color: #0000ff">Windows</span>,<span style="color: #008000">Mac OS X</span> and <span style="color: #008080">Linux</span>.</span></span></span></p>
<p align="LEFT"><span style="color: #333333">→ <span style="font-family: Ubuntu"><span style="font-size: small">Auto-complete on keywords and functions(Code completion).</span></span></span></p>
<p align="LEFT"><span style="color: #333333">→ <span style="font-family: Ubuntu"><span style="font-size: small">Syntax highlighting and checking.</span></span></span></p>
<p align="LEFT"><span style="color: #333333">→ <span style="font-family: Ubuntu"><span style="font-size: small">Multiple features on indentation(incremental searches, code folding, and code commenting, auto-indent, block selection, line ending and special character handling…)</span></span></span></p>
<p align="LEFT"><span style="color: #333333">→ <span style="font-family: Ubuntu"><span style="font-size: small">Very easy to use , so for beginners this can very handy.</span></span></span></p>
<p align="LEFT"><span style="color: #333333">→ <span style="font-family: Ubuntu"><span style="font-size: small">Support for multiple languages.</span></span></span></p>
<p align="LEFT"><span style="color: #333333">→ </span><span style="color: #800000"><span style="font-family: Ubuntu"><span style="font-size: small">Website</span></span></span><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">: </span></span></span><a href="http://www.activestate.com/komodo-edit"><span style="color: #004a8d"><span style="font-family: Ubuntu"><span style="font-size: small">http://www.activestate.com/komodo-edit</span></span></span></a></p>
<p align="LEFT"><span style="color: #333333"><img src="http://kunxi.org/files/komodo-edit.png" alt="" width="360" height="225" align="BOTTOM" border="0" vspace="10" /></span></p>
<h4 align="LEFT"><span style="color: #222222"><span style="font-family: Ubuntu"><span style="font-size: small">3.<span style="color: #000080">IDLE:</span></span></span></span></h4>
<p align="LEFT"><span style="color: #333333">→ <span style="font-family: Ubuntu"><span style="font-size: small">IDLE has most of the nice touches you want in a Python editor: commenting/uncommenting blocks; indenting/dedenting; regular expression searches; jump to line; and converting tabs to spaces or the reverse. IDLE starts out as an enhanced interactive shell window(with a bit better cut-and-paste, scroll-back, etc. than the basic interactive prompt).</span></span></span></p>
<p align="LEFT"><span style="color: #333333">→ <span style="font-family: Ubuntu"><span style="font-size: small">Bold color choices in the syntax highlighting.</span></span></span></p>
<p align="LEFT"><span style="color: #333333">→ <span style="font-family: Ubuntu"><span style="font-size: small"><span style="color: #0000ff"><span style="text-decoration: underline">Drawback</span></span>:This is a minor drawback yet, most of the menus have to be worked on with mouse only.</span></span></span></p>
<p align="LEFT"><span style="color: #333333">→ </span><span style="color: #800000"><span style="font-family: Ubuntu"><span style="font-size: small">Website</span></span></span><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">: </span></span></span><cite><a href="http://www.python.org/getit/"><span style="color: #004a8d"><span style="font-family: Ubuntu"><span style="font-size: small">www.</span></span></span></a></cite><strong><a href="http://www.python.org/getit/"><span style="color: #004a8d"><span style="font-family: Ubuntu"><span style="font-size: small">python</span></span></span></a></strong><cite><a href="http://www.python.org/getit/"><span style="color: #004a8d"><span style="font-family: Ubuntu"><span style="font-size: small">.org/getit/</span></span></span></a></cite></p>
<pre><span style="color: #333333">→ <span style="font-family: Ubuntu"><span style="font-size: small">In Ubuntu terminal: sudo apt-get install idle-python2.4</span></span></span></pre>
<p align="LEFT"><span style="color: #333333"><img src="http://www.voidspace.org.uk/python/weblog/images/movable-idle-2.5.png" alt="" width="350" height="253" align="BOTTOM" border="0" vspace="10" /></span></p>
<h4 align="LEFT"><span style="color: #222222"><span style="font-family: Ubuntu"><span style="font-size: small">4.<span style="color: #000080">NINJA-IDE:</span></span></span></span></h4>
<p align="LEFT"><span style="color: #333333">→ <span style="font-family: Ubuntu"><span style="font-size: small">Which stands for Ninja-IDE Is Not Just Another IDE, NINJA-IDE allows you to work with single scripts as well as manage complex projects consisting of multiple files and libraries.</span></span></span></p>
<p align="LEFT"><span style="color: #333333">→ </span><em><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">code completion</span></span></span></em><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small"> and </span></span></span><em><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">syntax coloring</span></span></span></em><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small"> as well as error warnings where error warnings are like detects and highlights common formatting problems like excessive or missing white spaces, incorrect indentation, long lines, etc.</span></span></span></p>
<p align="LEFT"><span style="color: #333333">→ <span style="font-family: Ubuntu"><span style="font-size: small">Hovering the mouse over a specific code will give the briefing about the data.</span></span></span></p>
<p align="LEFT"><span style="color: #333333">→ <span style="font-family: Ubuntu"><span style="font-size: small">It has an embedded python console which enables you to run the scripts.</span></span></span></p>
<p align="LEFT"><span style="color: #333333">→ </span><span style="color: #800000"><span style="font-family: Ubuntu"><span style="font-size: small">Website</span></span></span><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">: </span></span></span><a href="http://ninja-ide.org/"><span style="color: #004a8d"><span style="font-family: Ubuntu"><span style="font-size: small">http://ninja-ide.org/</span></span></span></a></p>
<p align="LEFT"><span style="color: #333333"><img src="http://wedge.org/pub/off/6766/php-ide-for-windows/do/dlattach/?attach=3374;image" alt="" width="384" height="273" align="BOTTOM" border="0" vspace="10" /></span></p>
<h4 align="LEFT"><span style="color: #222222"><span style="font-family: Ubuntu"><span style="font-size: small">5.<span style="color: #000080">Pydev:</span></span></span></span></h4>
<p align="LEFT"><span style="color: #333333">→ </span><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">PyDev is a </span></span></span><strong><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">Python IDE</span></span></span></strong><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small"> for </span></span></span><strong><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">Eclipse</span></span></span></strong><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">, which may be used in </span></span></span><strong><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">Python</span></span></span></strong><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">, </span></span></span><strong><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">Jython</span></span></span></strong><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small"> and </span></span></span><strong><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">IronPython</span></span></span></strong><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">development. Important feature of this is </span></span></span><a href="http://en.wikipedia.org/wiki/Code_completion#In_source_code_editors"><span style="color: #004a8d"><span style="font-family: Ubuntu"><span style="font-size: small">Code completion</span></span></span></a><span style="color: #333333"><span style="font-family: Ubuntu"><span style="font-size: small">,</span></span></span></p>
<p align="LEFT"><span style="color: #333333">→ <span style="font-family: Ubuntu"><span style="font-size: small"><span style="color: #008080"><span style="text-decoration: underline">Pre-requisites</span></span><span style="text-decoration: underline">:</span> Eclipse SDK 3.7.0, Git and Java 5.0 (note that other versions of those should work too but details may differ a bit)</span></span></span></p>
<p align="LEFT"><span style="color: #333333">→ <span style="font-family: Ubuntu"><span style="font-size: small"><span style="color: #0000ff"><span style="text-decoration: underline">Drawbacks</span></span>: Code completion will not work unless you</span></span></span></p>
<p align="LEFT">→ <span style="color: #800000">Website:</span> <a href="http://pydev.org/">http://pydev.org</a></p>
<div class="wp-caption aligncenter" style="width: 660px"><img src="http://www.zefhemel.com/upload/pydev-snap.gif" alt="" width="650" height="451" /><p class="wp-caption-text">PyDev</p></div>
<h4 align="LEFT">6. <span style="color: #000080">WingIDE</span></h4>
<p align="LEFT">→ Wingware&#8217;s Wing IDE is available in three editions: Professional, Personal, and Wing IDE 101. All versions will run on Windows, Mac, and Linux, and all support the 2.x versions of Python, as well as Python 3.0 and 3.1.</p>
<p align="LEFT">→ The Wing IDE layout is straightforward, with the editor window being its central fixture. Supporting panes, source browser, runtime output and debug panes and so on, are arranged on the periphery. In the lower right is the eminently useful Source Assistant pane, the Wing IDE&#8217;s answer to call tips.</p>
<p align="LEFT">→ Code Completion and matching.</p>
<p align="LEFT">→ Wingware&#8217;s debugger one of the best feature of Wing IDE, which is highly configurable and supports remote debugging.</p>
<p align="LEFT">→ <span style="color: #800000">Website</span>: <a href="http://www.wingware.com/">http://www.wingware.com/</a></p>
<div class="wp-caption aligncenter" style="width: 394px"><img class=" " src="http://wingware.com/psupport/talks/pycon2008/talk-5min/screen2-small.jpg" alt="" width="384" height="273" /><p class="wp-caption-text">WingIDE</p></div>
<h4 align="LEFT">7.<span style="color: #0000ff">Geany</span></h4>
<p align="LEFT">→ Geany is a lightweight cross-platform <a href="http://en.wikipedia.org/wiki/GTK%2B">GTK+</a> <a href="http://en.wikipedia.org/wiki/Text_editor">text editor</a> based on <a href="http://en.wikipedia.org/wiki/Scintilla_%28editing_component%29">Scintilla</a> and including basic <a href="http://en.wikipedia.org/wiki/Integrated_Development_Environment">Integrated Development Environment</a> (IDE) features.</p>
<p align="LEFT">→ With many features like syntax-highlighting, Auto-completion,<a href="http://en.wikipedia.org/wiki/Multiple_document_interface">Multiple document</a> support and many more.</p>
<p align="LEFT">→ This is also available for a wide range of operating systems, such as <a href="http://en.wikipedia.org/wiki/BSD">BSD</a>, <a href="http://en.wikipedia.org/wiki/Linux">Linux</a>, <a href="http://en.wikipedia.org/wiki/Mac_OS_X">Mac OS X</a>, <a href="http://en.wikipedia.org/wiki/Solaris_%28operating_system%29">Solaris</a> and <a href="http://en.wikipedia.org/wiki/Microsoft_Windows">Windows</a>.</p>
<p align="LEFT">→ Another amazing thing to know is with all these features the developers of the program (Nick Treleaven, Enrico Troger and Frank Lanitz) managed to keep the size so small.</p>
<p align="LEFT">→ <span style="color: #800000">Website</span>: <a href="http://www.geany.org/Main/HomePage">http://www.geany.org/Main/HomePage</a></p>
<div id="attachment_1456" class="wp-caption aligncenter" style="width: 394px"><img class=" wp-image-1456 " src="http://www.linuxcandy.com/wp-content/uploads/2012/07/geany_main-300x248.png" alt="" width="384" height="273" /><p class="wp-caption-text">Geany</p></div>
<h2 align="LEFT"><span style="text-decoration: underline;color: #800000"><strong>Text Editors</strong></span></h2>
<p align="LEFT">The list of Text Editors is made in view of <em>Extensibility</em>(whether the editor supports plugins, extensions)<em>,Speed</em>(Rates the startup time,performance)<em>,Cross</em>-platform(multiple OS),<em>Power</em>(Features, Editing modes)<em> and Beginner friendliness.</em></p>
<h4 align="LEFT"><span style="color: #000080">1.Vim/VI:</span></h4>
<p align="LEFT">→ Released in 1991 this versatile and powerful editor gained a massive following in the open source world.</p>
<p align="LEFT">→ Light and fast</p>
<p align="LEFT">→ Goes over ssh very well</p>
<p align="LEFT">→ Simple configuration</p>
<p align="LEFT">→ Lots of flexibility</p>
<p align="LEFT">→ It is open source software and comes preinstalled on most Linux systems.</p>
<p align="LEFT">→ <span style="color: #800000">Website</span>: <a href="http://www.vim.org/">http://www.vim.org/</a></p>
<p align="LEFT">→<span style="text-decoration: underline;color: #0000ff"> Drawbacks </span>: This is definitely not for Beginners, my advice to them is learn to use VI/Vim which is very useful and can be learnt using <a href="http://linuxcommand.org/man_pages/vimtutor1.html">Vimtutor</a>.</p>
<div class="wp-caption aligncenter" style="width: 394px"><img class=" " src="http://luv.asn.au/overheads/prog/images/vim.gif" alt="" width="384" height="273" /><p class="wp-caption-text">Vim/VI</p></div>
<h4 align="LEFT"><span style="color: #000080">2.Emacs:</span></h4>
<p align="LEFT">→ Development of Emacs started in the 1970 and is said to be one of the first to implement implement syntax highlighting, support for multiple programming languages and automatic indentation.</p>
<p align="LEFT">→ Quick execution, transparent functionality and customisable.</p>
<p align="LEFT">→ The <a href="http://orgmode.org/">Org-mode</a> addon in Emacs gives a superhero powers to it, the powers are task management ,connect with other applications( HTML, latex beamer, google calendar) ,table creation and Good for draft/notes preparation, etc.</p>
<p align="LEFT">→ Emacs is free and open source software</p>
<p align="LEFT">→ <span style="color: #800000">Website</span>: <a href="http://www.gnu.org/software/emacs">http://www.gnu.org/software/emacs</a></p>
<div class="wp-caption aligncenter" style="width: 394px"><img class=" " src="http://images.pedrokroger.net/emacs-python-code-completion-2.png" alt="" width="384" height="273" /><p class="wp-caption-text">Emacs</p></div>
<h4 align="LEFT"><span style="color: #000080">3.Sublime Text2:</span></h4>
<p align="LEFT">→ A cross-platform code editor, which supports multiple selections, code folding, keyboard bindings, macros, split screen editing and projects.</p>
<p align="LEFT">→ Fullscreen and distraction-free modes, which look great on big displays.</p>
<p align="LEFT">→ It runs on Linux, Windows and OSX.</p>
<p align="LEFT">→ A proprietary software.</p>
<p align="LEFT">→<span style="color: #800000">Website</span>: <a href="http://www.sublimetext.com/">http://www.sublimetext.com/</a></p>
<div class="wp-caption aligncenter" style="width: 394px"><img class=" " src="https://lh6.googleusercontent.com/-rjt33byD0RU/T8pJrIcP5fI/AAAAAAAAI0k/SDaO2hXb2JI/image-1.png" alt="" width="384" height="273" /><p class="wp-caption-text">Sublime Text2</p></div>
<h4 align="LEFT"><span style="color: #000080">4.Eclipse IDE:</span></h4>
<p align="LEFT">→ Eclipse is a kind of universal tool platform &#8211; an open extensible IDE for anything and nothing in particular.</p>
<p align="LEFT">→S<em>yntax highlighting</em> to allow for easy location of code segments with just a glance.</p>
<p align="LEFT">→ Search/Grep feature of Eclipse to search through your python source code modules.</p>
<p align="LEFT">→ Eclipse <em>bookmarking</em> and create <em>task</em> bookmarks inside the eclipse python editor.</p>
<p align="LEFT">→ Eclipse offers powerful code hinting, built in documentation and real-time syntax checking.</p>
<p align="LEFT">→ Eclipse is free and open source.</p>
<p align="LEFT">→ <span style="color: #800000">Website</span>:<a href="http://www.eclipse.org/">http://www.eclipse.org/</a></p>
<p align="LEFT">→ <span style="text-decoration: underline;color: #0000ff">Drawbacks</span>:Eclipse has frequently been reported for being slow on large projects.</p>
<div class="wp-caption aligncenter" style="width: 394px"><img class=" " src="http://larjona.files.wordpress.com/2011/09/eclipse-pydev.png" alt="" width="384" height="273" /><p class="wp-caption-text">Eclipse IDE</p></div>
<h4 align="LEFT"><span style="color: #000080">5.Aptana Studio:</span></h4>
<p align="LEFT">→ Aptana Studio is based on Eclipse.</p>
<p align="LEFT">→ It comes in both a <em>Stand-alone Version</em> and as an<em> Eclipse Plug-in</em>. The stand-alone version is quite a large file (130.7 MB for Windows), so I would recommend getting the plugin if you already have Eclipse 3.5 or higher. Both editions are available for the Mac OS X, Windows (x86 &#8211; x64 Compatible), and Linux operating systems.</p>
<p align="LEFT">→ Very helpful for web developers.</p>
<p align="LEFT">→ It has Git integration, ability to deploy your application to remote servers and bundles of useful code snippets and actions for every language.</p>
<p align="LEFT">→ Aptana is free and open source.</p>
<p align="LEFT">→ <span style="color: #800000">Website</span>: <a href="http://www.aptana.org/">http://www.aptana.org/</a></p>
<div class="wp-caption aligncenter" style="width: 394px"><img class=" " src="http://b.vimeocdn.com/ts/277/607/27760725_640.jpg" alt="" width="384" height="273" /><p class="wp-caption-text">Aptana Studio</p></div>
<h4 align="LEFT"><span style="color: #000080">6.Netbeans:</span></h4>
<p align="LEFT">→ A free, open-source Integrated Development Environment for software developers.</p>
<p align="LEFT">→ Speciality of this superhero lies in Java development though</p>
<p align="LEFT">→ Syntax-highlighting</p>
<p align="LEFT">→ It runs on Linux, Windows and OSX.</p>
<p align="LEFT">→ <span style="color: #800000">Website</span>: <a href="http://www.netbeans.org/">http://www.netbeans.org/</a></p>
<p align="LEFT">→ <span style="text-decoration: underline"><span style="color: #008080;text-decoration: underline">Drawbacks</span>:</span>Netbeans has frequently been reported for being slow on large projects.</p>
<div class="wp-caption aligncenter" style="width: 410px"><img src="http://3.bp.blogspot.com/_k7-jvtv2cLo/ST6Pp2d_nYI/AAAAAAAAASQ/ru-pIQh4gGo/s400/netbeans_6.5_python.jpg" alt="" width="400" height="359" /><p class="wp-caption-text">Netbeans</p></div>
<h4 align="LEFT"><span style="color: #000080">7.TextMate:</span></h4>
<p align="LEFT">→ Created by a closet UNIX geek who was lured to the Mac platform by its ease of use and elegance, TextMate has been referred to as the culmination of Emacs and OS X.</p>
<p align="LEFT">→ Extensive support for macros and bundles, code folding, snippets, shell integration, clipboard history and project management.</p>
<p align="LEFT">→ Completion of Words from Current Document.</p>
<p align="LEFT">→ Proprietary software.</p>
<p align="LEFT">→ <span style="color: #800000">Website</span>: <a href="http://macromates.com/">http://macromates.com/</a></p>
<div class="wp-caption aligncenter" style="width: 394px"><img class=" " src="http://www.qlplugins.com/sites/default/files/textmate-large.jpg" alt="" width="384" height="273" /><p class="wp-caption-text">Textmate</p></div>
<h4 align="LEFT"><span style="color: #000080">8.Notepad++:</span></h4>
<p align="LEFT">→ I will rate this as most user friendly Text editor, which is very easy to use.</p>
<p align="LEFT">→ The editor also has support for split screen editing,an FTP browser, macros and powerful text editing capabilities.</p>
<p align="LEFT">→ Notepad++ is a free (as in &#8220;free speech&#8221; and also as in &#8220;free beer&#8221;).</p>
<p align="LEFT">→ <span style="color: #800000">Website</span>: <a href="http://www.notepad-plus-plus.org/">http://www.notepad-plus-plus.org/</a></p>
<div class="wp-caption aligncenter" style="width: 394px"><img class=" " src="http://mwolk.com/blog/wp-content/uploads/2009/05/scrsh_dockingfeature.png" alt="" width="384" height="273" /><p class="wp-caption-text">Notepad++</p></div>
<p>Further Readings:</p>
<address>IDE</address>
<address><a href="http://wiki.python.org/moin/IntegratedDevelopmentEnvironments">http://wiki.python.org/moin/IntegratedDevelopmentEnvironments</a></address>
<address>Choosing an editor</address>
<address><a href="http://www.ibiblio.org/g2swap/byteofpython/read/choosing-an-editor.html">http://www.ibiblio.org/g2swap/byteofpython/read/choosing-an-editor.html</a></address>
<address>NINJA- IDE:</address>
<address><a href="http://www.linux-magazine.com/Online/Blogs/Productivity-Sauce/Do-Python-Coding-with-NINJA-IDE/">http://www.linux-magazine.com/Online/Blogs/Productivity-Sauce/Do-Python-Coding-with-NINJA-IDE/</a></address>
<address>Komodo Edit:</address>
<address><a href="http://www.brighthub.com/internet/web-development/reviews/85090.aspx">http://www.brighthub.com/internet/web-development/reviews/85090.aspx</a></address>
<address>SPE review</address>
<address><a href="http://review.techworld.com/applications/3238831/spe-review/">http://review.techworld.com/applications/3238831/spe-review/</a></address>
<address>IDLE review</address>
<address><a href="http://www.ibm.com/developerworks/linux/library/l-cpyide/">http://www.ibm.com/developerworks/linux/library/l-cpyide/</a></address>
<address> </address>
<address>We convered how to install python and you should have got an idea on which IDE will suit you to get started writing python codes.<br />
This is going to be a continuous series of python tutorials. If you want to learn python with us subscribe to our newsletter and get update as soon as we make a post. </address>
<address> </address>
<address> <img src='http://www.linuxcandy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </address>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxcandy.com/2012/07/which-python-ide-is-best-choose-your-own.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Installing Python</title>
		<link>http://www.linuxcandy.com/2012/07/installing-python.html</link>
		<comments>http://www.linuxcandy.com/2012/07/installing-python.html#comments</comments>
		<pubDate>Fri, 13 Jul 2012 08:22:25 +0000</pubDate>
		<dc:creator>Mr Spark</dc:creator>
				<category><![CDATA[linux class]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[installing python]]></category>
		<category><![CDATA[linux tutorial]]></category>

		<guid isPermaLink="false">http://www.linuxcandy.com/?p=1351</guid>
		<description><![CDATA[Installing Python Since am a member of open source community, let me first show you how to install Python in your Linux/Ubuntu then will move on to Windows. Linux: If you are using a Linux distribution such as Fedora or Mandrake or {put your choice here}, or a BSD system such as FreeBSD, then you [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.linuxcandy.com/wp-content/uploads/2012/07/python-icon.jpg"><img class="aligncenter size-full wp-image-1550" title="python-icon" src="http://www.linuxcandy.com/wp-content/uploads/2012/07/python-icon.jpg" alt="" width="230" height="228" /></a></p>
<p><strong>Installing <span style="color: #800000;">Python</span></strong></p>
<p>Since am a member of open source community, let me first show you how to install Python in your <span style="color: #008000;">Linux/Ubuntu</span> then will move on to Windows.</p>
<h2><strong>Linux:</strong></h2>
<p>If you are using a Linux distribution such as Fedora or Mandrake or {put your choice here}, or a BSD system such as FreeBSD, then you probably already have Python installed on your system.</p>
<p>To test if you have Python already installed on your Linux box, open a shell program (like konsole or gnome-terminal) and enter the command <strong>python -V</strong> as shown below.</p>
<div>
<pre>thor@goopta:~$ python
Python 2.7.3 (default, Apr 20 2012, 22:44:07)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt;</pre>
</div>
<div>
<h3>Note</h3>
<p><code>$</code> is the prompt of the shell. It will be different for you depending on the settings of your OS, hence I will indicate the prompt by just the <code>$</code> symbol.</p>
</div>
<p>If you see some version information like the one shown above, then you have Python installed already.</p>
<p>However, if you get a message like this one:</p>
<pre>$ python -V
bash: python: command not found</pre>
<p>then, you don&#8217;t have Python installed. This is highly unlikely but possible.</p>
<p>In this case, you have two ways of installing Python on your system.</p>
<div>
<ul type="disc">
<li>Install the binary packages using the package management software that comes with your OS, such as yum in Fedora Linux, urpmi in Mandrake Linux, apt-get in Debian Linux, pkg_add in FreeBSD, etc. Note that you will need an internet connection to use this method.Alternatively, you can download the binaries from somewhere else and then copy to your PC and install it.</li>
<li>You can compile Python from the <a href="http://www.python.org/download/" target="_top">source code</a> and install it. The compilation instructions are provided at the website.</li>
</ul>
<p>For example in Ubuntu or Debian system you can install it by typing following in terminal:</p>
</div>
<pre><span style="color: #333399;">$ sudo apt-get install python</span></pre>
<p>this will install python in your system. Later on type “python” in your terminal to enter into the python interface. I guess by default prompt will be “&gt;&gt;&gt;”.</p>
<h2><strong>Windows:</strong></h2>
<p>In windows, visit <a href="http://www.python.org/download">http://www.python.org/download</a>, below figure shows which link to access.</p>
<p><a href="http://hacks8santosh.files.wordpress.com/2012/06/install.png"><img src="http://hacks8santosh.files.wordpress.com/2012/06/install.png?w=529" alt="click the link which is being pointed" /></a></p>
<p>A pop-up will come, then install the python.</p>
<p>You can access the Python interface by going<strong><em> Start→python→IDE(python GUI)</em></strong>. Using this Python interface will come to your screen.</p>
<h3><strong>Checking:</strong></h3>
<p>You can check whether it is installed properly by entering(same in all OS):</p>
<pre><span style="color: #800000;">&gt;&gt;&gt;print “<em>working..</em>”</span></pre>
<p>this will print</p>
<pre><span style="color: #000080;"><em>working…</em></span></pre>
<p>on your screen.Or we can perform arithmetic operations like 9+4 which will give result 13 on your screen.</p>
<pre>&gt;&gt;&gt;9+4
13</pre>
<p>—————————————————————————————————————————————</p>
<p>Thus, You have installed Python on your system.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxcandy.com/2012/07/installing-python.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python, lets begin!</title>
		<link>http://www.linuxcandy.com/2012/07/python-lets-begin.html</link>
		<comments>http://www.linuxcandy.com/2012/07/python-lets-begin.html#comments</comments>
		<pubDate>Sat, 07 Jul 2012 15:58:59 +0000</pubDate>
		<dc:creator>Mr Spark</dc:creator>
				<category><![CDATA[linux class]]></category>
		<category><![CDATA[linux tutorial]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.linuxcandy.com/?p=1222</guid>
		<description><![CDATA[Welcome to Python world! Here at linuxcandy we are going to begin python step by step crash course. Lets have a look on its history and we shall see its scope then turn ourselves into whirlpool of python language. subscribe linuxcandy feed if you want to learn python. And get yourself ready for it! Introducing [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.linuxcandy.com/wp-content/uploads/2012/07/python-icon.jpg"><img class="aligncenter size-full wp-image-1550" title="python-icon" src="http://www.linuxcandy.com/wp-content/uploads/2012/07/python-icon.jpg" alt="" width="230" height="228" /></a>Welcome to Python world! Here at linuxcandy we are going to begin python step by step crash course. Lets have a look on its history and we shall see its scope then turn ourselves into whirlpool of python language. subscribe linuxcandy feed if you want to learn python. And get yourself ready for it!</p>
<h1><span style="text-decoration: underline;">Introducing Python</span></h1>
<p>Python is a general purpose and a High level language. Programmers usually prefer Python because of its quick development. The modules and packages present in Python makes in versatile and also saves time. Many of us will be thinking that python language is named after a snake but its not true. The Python Language is named for Monty Python— remember its NOT the snake.</p>
<h2><span style="text-decoration: underline;">History of Python</span></h2>
<div id="attachment_1223" class="wp-caption alignright" style="width: 143px"><a href="http://www.linuxcandy.com/wp-content/uploads/2012/07/guidovanrossum.jpg"><img class=" wp-image-1223" src="http://www.linuxcandy.com/wp-content/uploads/2012/07/guidovanrossum.jpg" alt="Father of Python" width="133" height="200" /></a><p class="wp-caption-text">Father of Python</p></div>
<p>The Father of Python, <a href="http://en.wikipedia.org/wiki/Guido_van_Rossum">Guido van Rossum</a> created Python in the late 1980&#8242;s, and he was bestowed with the title &#8216;Benevolent Dictator For Life &#8216; by the Python community.</p>
<p>Guido had a different taste than other programmers although he liked the features of many programming languages, but couldn’t find the one which had all the features which he wanted,such as:</p>
<p>→ <em><span style="text-decoration: underline;">Indentation</span>: </em>Indentation makes a program more user-friendly by making it more readable. Like in C language we have {} braces to group instructions. Python was first to enforce indentation in it.</p>
<div id="attachment_1228" class="wp-caption aligncenter" style="width: 255px"><a href="http://www.linuxcandy.com/wp-content/uploads/2012/07/python-indents-dresscode.jpg"><img class=" wp-image-1228" src="http://www.linuxcandy.com/wp-content/uploads/2012/07/python-indents-dresscode.jpg" alt="" width="245" height="262" /></a><p class="wp-caption-text">Indentation in Python resulting into cleaner code</p></div>
<p>→ <span style="text-decoration: underline;"><em>Scripting language</em></span>: Scripts can be written and executed &#8220;on-the-fly&#8221;, without explicit compile and link steps, where a script can be said to be a short program used to handle memory and other programs.</p>
<p>→ <em><span style="text-decoration: underline;">Extensibility</span>:</em> One of the best things of Python is its extensive features which enables it to add data types, concepts, modules and plugins, where the group of programmers works on modifying and improving the language, while hundreds of other programmers write modules for specific purposes.</p>
<p>→ <span style="text-decoration: underline;"><em>Interpreter</em></span>: In C or C++ languages, we write the code in a platform where it has to be translated before run. Python on other hand makes the interpreted languages run directly from the source code.</p>
<h2><span style="text-decoration: underline;">Python:A Multi-paradigm programming language</span></h2>
<p>Python supports more than one style or philosophy of programming, which in a tech term it is referred as “<em>A Multi-paradigm programming language</em>”. Python supports OOPs(<a href="http://en.wikipedia.org/wiki/Object-oriented_programming">Object-Oriented Programming</a>) which can also termed as modular programming, which divides the data into small codes which themselves acts as function.</p>
<p>Python has many common features with other languages.</p>
<ul>
<li><span style="color: #800000;"><em>Java</em></span><em> or<span style="color: #800000;"> C++</span></em>: An object-oriented language especially for applications used over networks .</li>
<li><span style="color: #800000;"><em>Perl</em></span>: A procedural language used for text manipulation, system administration, Web development, and network programming</li>
<li><span style="color: #800000;"><em>Tcl</em></span>: Used for rapid prototyping, scripting, GUIs, and testing</li>
<li><span style="color: #800000;"><em>Scheme</em></span>: A functional programming language (a language that focuses on performing actions and calculations by using functions.)</li>
<li><span style="color: #800000;"><em>Javascript</em></span> : Supports a programming style where it depends on functions and variables without engaging itself in class definitions.</li>
<li><span style="color: #800000;"><em>Smalltalk</em></span>: Dynamic typing and binding;</li>
</ul>
<h2><span style="text-decoration: underline;">Famous Companies that use Python</span></h2>
<p>The main portal to Python and the Python community is <em>http://www.python.org</em>. This</p>
<p>portal contains a page that lists some companies that use Python, including</p>
<ul>
<li><span style="color: #ff6600;"><em>Yahoo! (for Yahoo! Maps) </em></span></li>
<li><span style="color: #008000;"><em>Google (for its spider and search engine) </em></span></li>
<li><span style="color: #000080;"><em>Linux Weekly News (published by using a Web application written in Python) </em></span></li>
<li><span style="color: #800080;"><em>Industrial Light &amp; Magic (used in the production of special effects for such movies as <span style="color: #800000;">The Phantom Menace</span> and <span style="color: #800000;">The Mummy Returns</span>). </em></span></li>
</ul>
<h3><span style="text-decoration: underline;"><strong>Bibliography</strong></span></h3>
<pre>→ <a href="http://en.wikipedia.org/wiki/History_of_Python">http://en.wikipedia.org/wiki/History_of_Python</a>
→ <strong>Programming Python, 4th Edition</strong> (Mark Lutz, O'Reilly Media, December 2010, 1600 pages)
→ <a href="http://thenewboston.org/">http://thenewboston.org</a>
→ <a href="http://www.python.org/doc/essays/comparisons.html">http://www.python.org/doc/essays/comparisons.html</a>
<strong>→ Python for dummies</strong>
→ <a href="http://mikelev.in/">http://mikelev.in</a></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxcandy.com/2012/07/python-lets-begin.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->