<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Python File Read Write with Urllib2</title>
	<atom:link href="http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/</link>
	<description>Software &#62; Technology &#62; Programming for Non-Engineers</description>
	<lastBuildDate>Mon, 02 Jan 2012 20:16:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Daisy</title>
		<link>http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/comment-page-1/#comment-11861</link>
		<dc:creator>Daisy</dc:creator>
		<pubDate>Sat, 02 Apr 2011 11:51:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/#comment-11861</guid>
		<description>Thank you for this post, it is really helpful for me as a beginner with python. I wonder how could we use it to download videos say from youtube. Any Ideas.</description>
		<content:encoded><![CDATA[<p>Thank you for this post, it is really helpful for me as a beginner with python. I wonder how could we use it to download videos say from youtube. Any Ideas.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Burns</title>
		<link>http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/comment-page-1/#comment-11837</link>
		<dc:creator>Josh Burns</dc:creator>
		<pubDate>Fri, 18 Mar 2011 19:13:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/#comment-11837</guid>
		<description>This is also a great introduction for someone to hit the ground running using Python in an applicable manner. Have you ever messed with multi-threaded processes in Python? In the case you REALLY want to speed some things up.. :-D</description>
		<content:encoded><![CDATA[<p>This is also a great introduction for someone to hit the ground running using Python in an applicable manner. Have you ever messed with multi-threaded processes in Python? In the case you REALLY want to speed some things up.. <img src='http://www.techniqal.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/comment-page-1/#comment-11467</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Tue, 18 Jan 2011 23:55:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/#comment-11467</guid>
		<description>I agree Haroldo. Maybe I&#039;ll do a post about how to get the same thing achieved using Python 3. Thanks for checking out my post.

UPDATE: I wrote a new post outlining how to do the same thing with Python3.  &lt;a href=&quot;http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/&quot; rel=&quot;nofollow&quot;&gt;python-file-read-write-with-urllib2&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>I agree Haroldo. Maybe I&#8217;ll do a post about how to get the same thing achieved using Python 3. Thanks for checking out my post.</p>
<p>UPDATE: I wrote a new post outlining how to do the same thing with Python3.  <a href="http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/" rel="nofollow">python-file-read-write-with-urllib2</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Haroldo</title>
		<link>http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/comment-page-1/#comment-11466</link>
		<dc:creator>Haroldo</dc:creator>
		<pubDate>Tue, 18 Jan 2011 22:51:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/#comment-11466</guid>
		<description>Thanks. It&#039;s a pity that with python 3, urllib no longer works the same.</description>
		<content:encoded><![CDATA[<p>Thanks. It&#8217;s a pity that with python 3, urllib no longer works the same.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joe</title>
		<link>http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/comment-page-1/#comment-11069</link>
		<dc:creator>joe</dc:creator>
		<pubDate>Fri, 01 Oct 2010 15:10:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/#comment-11069</guid>
		<description>this is the perfect post and script helped me more than 3 days of chit-chat on stackoverflow...Thanks you</description>
		<content:encoded><![CDATA[<p>this is the perfect post and script helped me more than 3 days of chit-chat on stackoverflow&#8230;Thanks you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Clark</title>
		<link>http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/comment-page-1/#comment-11068</link>
		<dc:creator>Alex Clark</dc:creator>
		<pubDate>Tue, 28 Sep 2010 17:50:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/#comment-11068</guid>
		<description>Whoah daddy, thanks for this!</description>
		<content:encoded><![CDATA[<p>Whoah daddy, thanks for this!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/comment-page-1/#comment-11063</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Mon, 13 Sep 2010 15:07:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/#comment-11063</guid>
		<description>You need it install a basic auth handler to urlllib 2. There are 2 methods to do that. 
1. Detect a 401 error, and send back the appropriate headers.
2. If you know the uri you are logging into you can install it with the appropriate credentials before you call urlopen.

Great example here from http://docs.python.org/library/urllib2.html:
import urllib2
# Create an OpenerDirector with support for Basic HTTP Authentication...
auth_handler = urllib2.HTTPBasicAuthHandler()
auth_handler.add_password(realm=&#039;PDQ Application&#039;,
                          uri=&#039;https://mahler:8092/site-updates.py&#039;,
                          user=&#039;klem&#039;,
                          passwd=&#039;kadidd!ehopper&#039;)
opener = urllib2.build_opener(auth_handler)
# ...and install it globally so it can be used with urlopen.
urllib2.install_opener(opener)
urllib2.urlopen(&#039;http://www.example.com/login.html&#039;)</description>
		<content:encoded><![CDATA[<p>You need it install a basic auth handler to urlllib 2. There are 2 methods to do that.<br />
1. Detect a 401 error, and send back the appropriate headers.<br />
2. If you know the uri you are logging into you can install it with the appropriate credentials before you call urlopen.</p>
<p>Great example here from <a href="http://docs.python.org/library/urllib2.html" rel="nofollow">http://docs.python.org/library/urllib2.html</a>:<br />
import urllib2<br />
# Create an OpenerDirector with support for Basic HTTP Authentication&#8230;<br />
auth_handler = urllib2.HTTPBasicAuthHandler()<br />
auth_handler.add_password(realm=&#8217;PDQ Application&#8217;,<br />
                          uri=&#8217;https://mahler:8092/site-updates.py&#8217;,<br />
                          user=&#8217;klem&#8217;,<br />
                          passwd=&#8217;kadidd!ehopper&#8217;)<br />
opener = urllib2.build_opener(auth_handler)<br />
# &#8230;and install it globally so it can be used with urlopen.<br />
urllib2.install_opener(opener)<br />
urllib2.urlopen(&#8216;<a href="http://www.example.com/login.html" rel="nofollow">http://www.example.com/login.html</a>&#8216;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bast</title>
		<link>http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/comment-page-1/#comment-11061</link>
		<dc:creator>Bast</dc:creator>
		<pubDate>Sun, 12 Sep 2010 05:01:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/#comment-11061</guid>
		<description>Thanks, how does this work with basic authentication?</description>
		<content:encoded><![CDATA[<p>Thanks, how does this work with basic authentication?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Peterson</title>
		<link>http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/comment-page-1/#comment-10996</link>
		<dc:creator>Scott Peterson</dc:creator>
		<pubDate>Thu, 13 May 2010 07:16:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/#comment-10996</guid>
		<description>Works great.  Thank you.</description>
		<content:encoded><![CDATA[<p>Works great.  Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryce Thomas</title>
		<link>http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/comment-page-1/#comment-10851</link>
		<dc:creator>Bryce Thomas</dc:creator>
		<pubDate>Tue, 11 Aug 2009 00:57:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/#comment-10851</guid>
		<description>Thanks very much for this script.  I&#039;ve downloaded the google logo based on your example; now I just need to tweak your example a bit to download a series of PDF documents instead of images.</description>
		<content:encoded><![CDATA[<p>Thanks very much for this script.  I&#8217;ve downloaded the google logo based on your example; now I just need to tweak your example a bit to download a series of PDF documents instead of images.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kmilin</title>
		<link>http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/comment-page-1/#comment-10844</link>
		<dc:creator>Kmilin</dc:creator>
		<pubDate>Sat, 20 Jun 2009 20:26:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/#comment-10844</guid>
		<description>thanks a lot, it works! now, lets steal some stuff !!!!! XD</description>
		<content:encoded><![CDATA[<p>thanks a lot, it works! now, lets steal some stuff !!!!! XD</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/comment-page-1/#comment-10700</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Mon, 22 Sep 2008 15:11:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/#comment-10700</guid>
		<description>Hey daonb,&lt;br&gt;&lt;br&gt;the only reason I could see an issue with large files, is if the socket connection times out.&lt;br&gt;If you see this happening, check out the socket module. You can import it within this function, and set temporary timeout settings.</description>
		<content:encoded><![CDATA[<p>Hey daonb,</p>
<p>the only reason I could see an issue with large files, is if the socket connection times out.<br />If you see this happening, check out the socket module. You can import it within this function, and set temporary timeout settings.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: daonb</title>
		<link>http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/comment-page-1/#comment-10694</link>
		<dc:creator>daonb</dc:creator>
		<pubDate>Tue, 16 Sep 2008 11:56:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/#comment-10694</guid>
		<description>It works! I found your site googling for a &quot;urllib2 loop read&quot;. Thanks fro the script won&#039;t it have problems with large files?</description>
		<content:encoded><![CDATA[<p>It works! I found your site googling for a &#8220;urllib2 loop read&#8221;. Thanks fro the script won&#39;t it have problems with large files?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Served from: www.techniqal.com @ 2012-02-07 03:23:34 by W3 Total Cache -->
