<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Python Recipe: Open multiple files, search for matches, count your hits.</title>
	<atom:link href="http://www.palewire.com/2008/04/07/python-recipe-open-multiple-files-search-for-matches-count-your-hits-on-the-fly/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.palewire.com/2008/04/07/python-recipe-open-multiple-files-search-for-matches-count-your-hits-on-the-fly/</link>
	<description>life it ain't real funky, 'less it's got that pop...
</description>
	<pubDate>Wed, 07 Jan 2009 11:19:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Faustus</title>
		<link>http://www.palewire.com/2008/04/07/python-recipe-open-multiple-files-search-for-matches-count-your-hits-on-the-fly/#comment-143736</link>
		<dc:creator>Faustus</dc:creator>
		<pubDate>Tue, 25 Nov 2008 12:56:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.palewire.com/?p=95#comment-143736</guid>
		<description>Thank you very much, that was really useful for me (exactly what I was looking for, great!)</description>
		<content:encoded><![CDATA[<p>Thank you very much, that was really useful for me (exactly what I was looking for, great!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: palewire</title>
		<link>http://www.palewire.com/2008/04/07/python-recipe-open-multiple-files-search-for-matches-count-your-hits-on-the-fly/#comment-112511</link>
		<dc:creator>palewire</dc:creator>
		<pubDate>Mon, 28 Jul 2008 00:37:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.palewire.com/?p=95#comment-112511</guid>
		<description>No problem, Marc. Thanks for checking in. It's rewarding to hear that somebody found it useful. If you have any ideas for new walkthroughs, just let me know. I kinda like doing it.</description>
		<content:encoded><![CDATA[<p>No problem, Marc. Thanks for checking in. It&#8217;s rewarding to hear that somebody found it useful. If you have any ideas for new walkthroughs, just let me know. I kinda like doing it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marc</title>
		<link>http://www.palewire.com/2008/04/07/python-recipe-open-multiple-files-search-for-matches-count-your-hits-on-the-fly/#comment-112157</link>
		<dc:creator>marc</dc:creator>
		<pubDate>Sun, 27 Jul 2008 08:42:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.palewire.com/?p=95#comment-112157</guid>
		<description>great tutorial! thanks very much for taking the time to put it out there.</description>
		<content:encoded><![CDATA[<p>great tutorial! thanks very much for taking the time to put it out there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: palewire / Python Recipe: Grab a page, scrape a table, download a file.</title>
		<link>http://www.palewire.com/2008/04/07/python-recipe-open-multiple-files-search-for-matches-count-your-hits-on-the-fly/#comment-74621</link>
		<dc:creator>palewire / Python Recipe: Grab a page, scrape a table, download a file.</dc:creator>
		<pubDate>Sun, 20 Apr 2008 20:50:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.palewire.com/?p=95#comment-74621</guid>
		<description>[...] a change of pace. Our first few lessons focused on how you can use Python to goof with a bunch of local files. This time [...]</description>
		<content:encoded><![CDATA[<p>[...] a change of pace. Our first few lessons focused on how you can use Python to goof with a bunch of local files. This time [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: t gun, hack reporter</title>
		<link>http://www.palewire.com/2008/04/07/python-recipe-open-multiple-files-search-for-matches-count-your-hits-on-the-fly/#comment-73126</link>
		<dc:creator>t gun, hack reporter</dc:creator>
		<pubDate>Tue, 15 Apr 2008 20:56:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.palewire.com/?p=95#comment-73126</guid>
		<description>you know how to make things work. i only know how to break em.</description>
		<content:encoded><![CDATA[<p>you know how to make things work. i only know how to break em.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: palewire / Python Recipe: Read a file, search for a pattern, print your matches.</title>
		<link>http://www.palewire.com/2008/04/07/python-recipe-open-multiple-files-search-for-matches-count-your-hits-on-the-fly/#comment-73097</link>
		<dc:creator>palewire / Python Recipe: Read a file, search for a pattern, print your matches.</dc:creator>
		<pubDate>Tue, 15 Apr 2008 18:30:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.palewire.com/?p=95#comment-73097</guid>
		<description>[...] first two recipes focused primarily on how to open one or more files and loop through them line by line. [...]</description>
		<content:encoded><![CDATA[<p>[...] first two recipes focused primarily on how to open one or more files and loop through them line by line. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: palewire</title>
		<link>http://www.palewire.com/2008/04/07/python-recipe-open-multiple-files-search-for-matches-count-your-hits-on-the-fly/#comment-73076</link>
		<dc:creator>palewire</dc:creator>
		<pubDate>Tue, 15 Apr 2008 16:17:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.palewire.com/?p=95#comment-73076</guid>
		<description>Hmm. Beats me. Maybe somebody who actually knows what they're doing can come in here and correct us both.</description>
		<content:encoded><![CDATA[<p>Hmm. Beats me. Maybe somebody who actually knows what they&#8217;re doing can come in here and correct us both.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: t gun</title>
		<link>http://www.palewire.com/2008/04/07/python-recipe-open-multiple-files-search-for-matches-count-your-hits-on-the-fly/#comment-72316</link>
		<dc:creator>t gun</dc:creator>
		<pubDate>Sun, 13 Apr 2008 02:49:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.palewire.com/?p=95#comment-72316</guid>
		<description>Thanks for the explanations and the links. I did it originally on Tiger, but it might the last version of Tiger 10.4.11 or something, maybe that makes a difference. I don't know if it's that dollar sign after "nietzsche/" or it likes a hash wildcard like your new version. I'll give it a try, thanks much!</description>
		<content:encoded><![CDATA[<p>Thanks for the explanations and the links. I did it originally on Tiger, but it might the last version of Tiger 10.4.11 or something, maybe that makes a difference. I don&#8217;t know if it&#8217;s that dollar sign after &#8220;nietzsche/&#8221; or it likes a hash wildcard like your new version. I&#8217;ll give it a try, thanks much!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: palewire</title>
		<link>http://www.palewire.com/2008/04/07/python-recipe-open-multiple-files-search-for-matches-count-your-hits-on-the-fly/#comment-72215</link>
		<dc:creator>palewire</dc:creator>
		<pubDate>Sat, 12 Apr 2008 15:09:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.palewire.com/?p=95#comment-72215</guid>
		<description>&lt;p&gt;Sounds like you figured out a Mac workaround there yourself. My original command worked on my laptop that runs Mac OS X Tiger, but, now that I try it,  does not work on my other laptop that runs Mac OS Leopard. Is that what you're running? I'm don't know how to explain it. Must be some quirk in how they interpret Unix &lt;a href="http://www.urbandictionary.com/define.php?term=ish" rel="nofollow"&gt;"ish."&lt;/a&gt; One other hackaround is to try another bit of command-line symbolry.&lt;/p&gt;
&lt;p&gt;curl -o nietzsche/#1.txt "http://www.gutenberg.org/dirs/etext05/7{zara,ecce,gbrt,gtzn,jnst,msch}10.txt"&lt;/p&gt;
&lt;p&gt;That seemed to work fine for me in Leopard.&lt;/p&gt;
&lt;p&gt;You don't actually have to declare "line" or "book." Since each appears in a magic spot in the "for ... in ... :" clause, python automagically gets it going. It's documented further &lt;a href="http://www.diveintopython.org/file_handling/for_loops.html" rel="nofollow"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Sounds like you figured out a Mac workaround there yourself. My original command worked on my laptop that runs Mac OS X Tiger, but, now that I try it,  does not work on my other laptop that runs Mac OS Leopard. Is that what you&#8217;re running? I&#8217;m don&#8217;t know how to explain it. Must be some quirk in how they interpret Unix <a href="http://www.urbandictionary.com/define.php?term=ish" rel="nofollow" onclick="javascript:pageTracker._trackPageview ('/outbound/www.urbandictionary.com');">&#8220;ish.&#8221;</a> One other hackaround is to try another bit of command-line symbolry.</p>
<p>curl -o nietzsche/#1.txt &#8220;http://www.gutenberg.org/dirs/etext05/7{zara,ecce,gbrt,gtzn,jnst,msch}10.txt&#8221;</p>
<p>That seemed to work fine for me in Leopard.</p>
<p>You don&#8217;t actually have to declare &#8220;line&#8221; or &#8220;book.&#8221; Since each appears in a magic spot in the &#8220;for &#8230; in &#8230; :&#8221; clause, python automagically gets it going. It&#8217;s documented further <a href="http://www.diveintopython.org/file_handling/for_loops.html" rel="nofollow" onclick="javascript:pageTracker._trackPageview ('/outbound/www.diveintopython.org');">here</a>.</p>
</p></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: t gun</title>
		<link>http://www.palewire.com/2008/04/07/python-recipe-open-multiple-files-search-for-matches-count-your-hits-on-the-fly/#comment-72176</link>
		<dc:creator>t gun</dc:creator>
		<pubDate>Sat, 12 Apr 2008 10:43:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.palewire.com/?p=95#comment-72176</guid>
		<description>another beaut, but left me with a few questions
first, and maybe cuz i'm on a mac, but the original command line:
curl "http://www.gutenberg.org/dirs/etext05/7{zara,ecce,gbrt,gtzn,jnst,msch}10.txt" -o nietzsche/$
returned me only one file, called "$", that seemed to only contained the last text, "msch". I went ahead and went into the nietzche directory and ran a truncated version, that seemed to work:
$ cd ./nietzsche$ curl -O "http://www.gutenberg.org/dirs/etext05/7{zara,ecce,gbrt,gtzn,jnst,msch}10.txt"
was I bad?
a python basic question:
Do you not have to declare the variable "book"? or variable "line" in that case, like you did with "path", "freddys_library", "file", "hit_count" and "text"
 
 </description>
		<content:encoded><![CDATA[<p>another beaut, but left me with a few questions<br />
first, and maybe cuz i&#8217;m on a mac, but the original command line:<br />
curl &#8220;http://www.gutenberg.org/dirs/etext05/7{zara,ecce,gbrt,gtzn,jnst,msch}10.txt&#8221; -o nietzsche/$<br />
returned me only one file, called &#8220;$&#8221;, that seemed to only contained the last text, &#8220;msch&#8221;. I went ahead and went into the nietzche directory and ran a truncated version, that seemed to work:<br />
$ cd ./nietzsche$ curl -O &#8220;http://www.gutenberg.org/dirs/etext05/7{zara,ecce,gbrt,gtzn,jnst,msch}10.txt&#8221;<br />
was I bad?<br />
a python basic question:<br />
Do you not have to declare the variable &#8220;book&#8221;? or variable &#8220;line&#8221; in that case, like you did with &#8220;path&#8221;, &#8220;freddys_library&#8221;, &#8220;file&#8221;, &#8220;hit_count&#8221; and &#8220;text&#8221;<br />
 <br />
 </p>
]]></content:encoded>
	</item>
</channel>
</rss>

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