<?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>Web Oom &#187; python</title>
	<atom:link href="http://web.pyncus.com/category/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://web.pyncus.com</link>
	<description>Build and Share Web Technology</description>
	<lastBuildDate>Mon, 25 Jan 2010 18:19:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>How to round the number in Python?</title>
		<link>http://web.pyncus.com/2009/12/28/how-to-round-the-number-in-python/</link>
		<comments>http://web.pyncus.com/2009/12/28/how-to-round-the-number-in-python/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 00:52:12 +0000</pubDate>
		<dc:creator>weboom</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://web.pyncus.com/?p=572</guid>
		<description><![CDATA[I want to make x=32.34565 to 32.35 How ? round(x,2)]]></description>
			<content:encoded><![CDATA[<p>I want to make<br />
x=32.34565<br />
to<br />
32.35</p>
<p>How ?<br />
round(x,2)</p>
]]></content:encoded>
			<wfw:commentRss>http://web.pyncus.com/2009/12/28/how-to-round-the-number-in-python/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>How to write lines (Python)</title>
		<link>http://web.pyncus.com/2009/12/22/how-to-write-lines-python/</link>
		<comments>http://web.pyncus.com/2009/12/22/how-to-write-lines-python/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 19:53:16 +0000</pubDate>
		<dc:creator>weboom</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[writelines]]></category>

		<guid isPermaLink="false">http://web.pyncus.com/?p=570</guid>
		<description><![CDATA[Use writelines() e.g. # read lines in a file import sys arg1 = sys.argv[1] f = open(arg1, 'r') lines = f.readlines() f.close() arg='out_'+arg1 FILE=open(arg,'w') for line in lines: words = line.split(' ') if words[1] == 'hypnos': FILE.writelines(line) FILE.close()]]></description>
			<content:encoded><![CDATA[<p>Use writelines()</p>
<p>e.g.</p>
<pre>
<p># read lines in a file<br />
import sys<br />
arg1 = sys.argv[1]</p>
<p>f = open(arg1, 'r')</p>
<p>lines = f.readlines()<br />
f.close()</p>
<p>arg='out_'+arg1<br />
FILE=open(arg,'w')</p>
<p>for line in lines:<br />
     words = line.split(' ')<br />
     if words[1] == 'hypnos':<br />
          FILE.writelines(line)<br />
FILE.close()</p>
]]></content:encoded>
			<wfw:commentRss>http://web.pyncus.com/2009/12/22/how-to-write-lines-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find word in a string (Python)</title>
		<link>http://web.pyncus.com/2009/12/22/find-word-in-a-string-python/</link>
		<comments>http://web.pyncus.com/2009/12/22/find-word-in-a-string-python/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 19:36:21 +0000</pubDate>
		<dc:creator>weboom</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[find]]></category>

		<guid isPermaLink="false">http://web.pyncus.com/?p=568</guid>
		<description><![CDATA[When you want to find a word in a string, use find() e.g. import sys arg1 = sys.argv[1] # passing the first argument if arg1.find("off") == -1: # if arg1 does not contain "off" # do something else: # do something]]></description>
			<content:encoded><![CDATA[<p>When you want to find a word in a string, use find()</p>
<p>e.g.</p>
<pre>
<p>import sys<br />
arg1 = sys.argv[1] # passing the first argument</p>
<p>if arg1.find("off") == -1: # if arg1 does not contain "off"<br />
  # do something<br />
else:<br />
  # do something</p>
]]></content:encoded>
			<wfw:commentRss>http://web.pyncus.com/2009/12/22/find-word-in-a-string-python/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Python: How to read lines</title>
		<link>http://web.pyncus.com/2009/12/22/python-how-to-read-lines/</link>
		<comments>http://web.pyncus.com/2009/12/22/python-how-to-read-lines/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 19:32:44 +0000</pubDate>
		<dc:creator>weboom</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[readlines]]></category>

		<guid isPermaLink="false">http://web.pyncus.com/?p=565</guid>
		<description><![CDATA[Use readlines() For example, arg = "filename" f = open(arg, 'r') lines = f.readlines() f.close()]]></description>
			<content:encoded><![CDATA[<p>Use readlines()</p>
<p>For example,</p>
<pre>
arg = "filename"

f = open(arg, 'r')

lines = f.readlines()
f.close()
</pre>
]]></content:encoded>
			<wfw:commentRss>http://web.pyncus.com/2009/12/22/python-how-to-read-lines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>High-level copy in Python: shutil</title>
		<link>http://web.pyncus.com/2009/11/29/high-level-copy-in-python-shutil/</link>
		<comments>http://web.pyncus.com/2009/11/29/high-level-copy-in-python-shutil/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 03:10:40 +0000</pubDate>
		<dc:creator>weboom</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[shutil]]></category>

		<guid isPermaLink="false">http://web.pyncus.com/?p=542</guid>
		<description><![CDATA[You can use shutil for high-level file operation (copy, move, delete etc.) in Python. e.g., &#62;&#62;&#62;import shutil &#62;&#62;&#62;shutil.copy(src,dest) src is a source file. dest is a target directory.]]></description>
			<content:encoded><![CDATA[<p>You can use shutil for high-level file operation (copy, move, delete etc.) in Python.</p>
<p>e.g.,</p>
<p>&gt;&gt;&gt;import shutil</p>
<p>&gt;&gt;&gt;shutil.copy(src,dest)</p>
<p>src is a source file.</p>
<p>dest is a target directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://web.pyncus.com/2009/11/29/high-level-copy-in-python-shutil/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to tell if it is directory or file in Python</title>
		<link>http://web.pyncus.com/2009/11/29/how-to-tell-if-it-is-directory-or-file-in-python/</link>
		<comments>http://web.pyncus.com/2009/11/29/how-to-tell-if-it-is-directory-or-file-in-python/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 03:08:23 +0000</pubDate>
		<dc:creator>weboom</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[isdir]]></category>

		<guid isPermaLink="false">http://web.pyncus.com/?p=540</guid>
		<description><![CDATA[&#62;&#62;&#62;import os &#62;&#62;&#62;os.path.isdir(fileordirectoryname) If directory, its output will be True. If not, it will be False.]]></description>
			<content:encoded><![CDATA[<p>&gt;&gt;&gt;import os</p>
<p>&gt;&gt;&gt;os.path.isdir(fileordirectoryname)</p>
<p>If directory, its output will be True.</p>
<p>If not, it will be False.</p>
]]></content:encoded>
			<wfw:commentRss>http://web.pyncus.com/2009/11/29/how-to-tell-if-it-is-directory-or-file-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to list files and subdirectories within a directory (Python)</title>
		<link>http://web.pyncus.com/2009/11/29/how-to-list-files-and-subdirectories-within-a-directory-python/</link>
		<comments>http://web.pyncus.com/2009/11/29/how-to-list-files-and-subdirectories-within-a-directory-python/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 03:05:38 +0000</pubDate>
		<dc:creator>weboom</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[listdir]]></category>

		<guid isPermaLink="false">http://web.pyncus.com/?p=538</guid>
		<description><![CDATA[&#62;&#62;&#62;import os &#62;&#62;&#62;os.listdir(&#8216;.&#8217;) This will make a list containing the names of files and subdirectories.]]></description>
			<content:encoded><![CDATA[<p>&gt;&gt;&gt;import os</p>
<p>&gt;&gt;&gt;os.listdir(&#8216;.&#8217;)</p>
<p>This will make a list containing the names of files and subdirectories.</p>
]]></content:encoded>
			<wfw:commentRss>http://web.pyncus.com/2009/11/29/how-to-list-files-and-subdirectories-within-a-directory-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to change directory in python</title>
		<link>http://web.pyncus.com/2009/11/29/how-to-change-directory-in-python/</link>
		<comments>http://web.pyncus.com/2009/11/29/how-to-change-directory-in-python/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 02:59:50 +0000</pubDate>
		<dc:creator>weboom</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[chdir]]></category>
		<category><![CDATA[os]]></category>

		<guid isPermaLink="false">http://web.pyncus.com/?p=536</guid>
		<description><![CDATA[&#62;&#62;&#62;import os &#62;&#62;&#62;os.chdir(&#8216;..&#8217;) &#62;&#62;&#62;os.chdir(&#8216;/home/weboom/&#8217;)]]></description>
			<content:encoded><![CDATA[<p>&gt;&gt;&gt;import os</p>
<p>&gt;&gt;&gt;os.chdir(&#8216;..&#8217;)</p>
<p>&gt;&gt;&gt;os.chdir(&#8216;/home/weboom/&#8217;)</p>
]]></content:encoded>
			<wfw:commentRss>http://web.pyncus.com/2009/11/29/how-to-change-directory-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to pass command line argument in Python</title>
		<link>http://web.pyncus.com/2009/11/28/how-to-pass-command-line-argument-in-python/</link>
		<comments>http://web.pyncus.com/2009/11/28/how-to-pass-command-line-argument-in-python/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 08:21:35 +0000</pubDate>
		<dc:creator>weboom</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[argument pass]]></category>
		<category><![CDATA[import sys]]></category>

		<guid isPermaLink="false">http://web.pyncus.com/?p=527</guid>
		<description><![CDATA[&#62;python program.py arg1 arg2 To get arg1 and arg2 &#8212;&#8212;- import sys arg1 = sys.argv[1] arg2 = sys.argv[2]]]></description>
			<content:encoded><![CDATA[<p>&gt;python program.py arg1 arg2</p>
<p>To get arg1 and arg2</p>
<p>&#8212;&#8212;-</p>
<p>import sys</p>
<p>arg1 = sys.argv[1]</p>
<p>arg2 = sys.argv[2]</p>
]]></content:encoded>
			<wfw:commentRss>http://web.pyncus.com/2009/11/28/how-to-pass-command-line-argument-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>List Index out of Range</title>
		<link>http://web.pyncus.com/2009/11/18/list-index-out-of-range/</link>
		<comments>http://web.pyncus.com/2009/11/18/list-index-out-of-range/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 22:25:28 +0000</pubDate>
		<dc:creator>weboom</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[list]]></category>

		<guid isPermaLink="false">http://web.pyncus.com/?p=480</guid>
		<description><![CDATA[You will get this error when there is no list element to access. For example, L=[1, 2, 3] L[4] doesn&#8217;t exist. If you try to call L[4], you will get the above error.]]></description>
			<content:encoded><![CDATA[<p>You will get this error when there is no list element to access.</p>
<p>For example,</p>
<p>L=[1, 2, 3]</p>
<p>L[4] doesn&#8217;t exist.</p>
<p>If you try to call L[4], you will get the above error.</p>
]]></content:encoded>
			<wfw:commentRss>http://web.pyncus.com/2009/11/18/list-index-out-of-range/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

