<?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: Trapping CTRL+C in Python</title>
	<atom:link href="http://stacyprowell.com/blog/2009/03/30/trapping-ctrlc-in-python/feed/" rel="self" type="application/rss+xml" />
	<link>http://stacyprowell.com/blog/2009/03/30/trapping-ctrlc-in-python/</link>
	<description>Ugh, Stacy's talking again...</description>
	<lastBuildDate>Mon, 30 Aug 2010 20:38:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Yuki</title>
		<link>http://stacyprowell.com/blog/2009/03/30/trapping-ctrlc-in-python/comment-page-1/#comment-149</link>
		<dc:creator>Yuki</dc:creator>
		<pubDate>Wed, 11 Aug 2010 17:43:13 +0000</pubDate>
		<guid isPermaLink="false">http://stacyprowell.com/blog/?p=123#comment-149</guid>
		<description>Hi.

This is exactly what I need. I implemented everything like you said but when I run it, it is as if there&#039;s a flag implemented even before I can implement the ctrl-c. Thus my loop only goes through 1 cycle.

Where does do_cleanup come from and is it necessary?</description>
		<content:encoded><![CDATA[<p>Hi.</p>
<p>This is exactly what I need. I implemented everything like you said but when I run it, it is as if there&#8217;s a flag implemented even before I can implement the ctrl-c. Thus my loop only goes through 1 cycle.</p>
<p>Where does do_cleanup come from and is it necessary?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sergio Philbin</title>
		<link>http://stacyprowell.com/blog/2009/03/30/trapping-ctrlc-in-python/comment-page-1/#comment-141</link>
		<dc:creator>Sergio Philbin</dc:creator>
		<pubDate>Mon, 14 Jun 2010 05:34:04 +0000</pubDate>
		<guid isPermaLink="false">http://stacyprowell.com/blog/?p=123#comment-141</guid>
		<description>Fantastic post, I will save this post in my Del.icio.us account. Have a great evening.</description>
		<content:encoded><![CDATA[<p>Fantastic post, I will save this post in my Del.icio.us account. Have a great evening.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: demikaze</title>
		<link>http://stacyprowell.com/blog/2009/03/30/trapping-ctrlc-in-python/comment-page-1/#comment-119</link>
		<dc:creator>demikaze</dc:creator>
		<pubDate>Wed, 12 May 2010 11:49:56 +0000</pubDate>
		<guid isPermaLink="false">http://stacyprowell.com/blog/?p=123#comment-119</guid>
		<description>ctrl-c generates KeyboardInterrupt exception... ;)</description>
		<content:encoded><![CDATA[<p>ctrl-c generates KeyboardInterrupt exception&#8230; <img src='http://stacyprowell.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stacy</title>
		<link>http://stacyprowell.com/blog/2009/03/30/trapping-ctrlc-in-python/comment-page-1/#comment-12</link>
		<dc:creator>stacy</dc:creator>
		<pubDate>Thu, 16 Apr 2009 02:22:13 +0000</pubDate>
		<guid isPermaLink="false">http://stacyprowell.com/blog/?p=123#comment-12</guid>
		<description>The single underscore signals that something is private &quot;by convention.&quot;  That is, you can still access the item, but the underscore signals that you shouldn&#039;t.

From PEP 8 (http://www.python.org/dev/peps/pep-0008/):

_single_leading_underscore: weak &quot;internal use&quot; indicator.  E.g. &quot;from M import *&quot; does not import objects whose name starts with an underscore.

The @property basically makes a read-only attribute.  That is, I can write:

bh = BreakHandler()
...
print bh.trapped
print bh.count

But I cannot set them with bh.trapped = True.

The @property is a decorator providing a shorthand for the python property() built in to declare a read-only property.  Python decorators are pretty nifty.  They are described in PEP 318 (http://www.python.org/dev/peps/pep-0318/).

See http://www.python.org/doc/2.6/library/functions.html and search for @property.</description>
		<content:encoded><![CDATA[<p>The single underscore signals that something is private &#8220;by convention.&#8221;  That is, you can still access the item, but the underscore signals that you shouldn&#8217;t.</p>
<p>From PEP 8 (<a href="http://www.python.org/dev/peps/pep-0008/" rel="nofollow">http://www.python.org/dev/peps/pep-0008/</a>):</p>
<p>_single_leading_underscore: weak &#8220;internal use&#8221; indicator.  E.g. &#8220;from M import *&#8221; does not import objects whose name starts with an underscore.</p>
<p>The @property basically makes a read-only attribute.  That is, I can write:</p>
<p>bh = BreakHandler()<br />
&#8230;<br />
print bh.trapped<br />
print bh.count</p>
<p>But I cannot set them with bh.trapped = True.</p>
<p>The @property is a decorator providing a shorthand for the python property() built in to declare a read-only property.  Python decorators are pretty nifty.  They are described in PEP 318 (<a href="http://www.python.org/dev/peps/pep-0318/" rel="nofollow">http://www.python.org/dev/peps/pep-0318/</a>).</p>
<p>See <a href="http://www.python.org/doc/2.6/library/functions.html" rel="nofollow">http://www.python.org/doc/2.6/library/functions.html</a> and search for @property.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aonlazio</title>
		<link>http://stacyprowell.com/blog/2009/03/30/trapping-ctrlc-in-python/comment-page-1/#comment-11</link>
		<dc:creator>aonlazio</dc:creator>
		<pubDate>Wed, 15 Apr 2009 18:26:33 +0000</pubDate>
		<guid isPermaLink="false">http://stacyprowell.com/blog/?p=123#comment-11</guid>
		<description>Superb, this is exactly what I want and I bet most people in network programming realm want too.
By the way I have a couple of questions
(1) Why do u use &quot;_&quot; in front of some properties such as self._count, self._enabled, self._emphatic ? Does it have special meanings?

(2) What does @property do?

    Thank you very much.

Aonlazio</description>
		<content:encoded><![CDATA[<p>Superb, this is exactly what I want and I bet most people in network programming realm want too.<br />
By the way I have a couple of questions<br />
(1) Why do u use &#8220;_&#8221; in front of some properties such as self._count, self._enabled, self._emphatic ? Does it have special meanings?</p>
<p>(2) What does @property do?</p>
<p>    Thank you very much.</p>
<p>Aonlazio</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stacy</title>
		<link>http://stacyprowell.com/blog/2009/03/30/trapping-ctrlc-in-python/comment-page-1/#comment-5</link>
		<dc:creator>stacy</dc:creator>
		<pubDate>Tue, 31 Mar 2009 20:30:17 +0000</pubDate>
		<guid isPermaLink="false">http://stacyprowell.com/blog/?p=123#comment-5</guid>
		<description>That&#039;s easy to do.  There&#039;s not much code; feel free to make the change!  You could also modify the code to allow trapping other signals.  I think on Windows the Break key generates a different signal than CTRL+C.</description>
		<content:encoded><![CDATA[<p>That&#8217;s easy to do.  There&#8217;s not much code; feel free to make the change!  You could also modify the code to allow trapping other signals.  I think on Windows the Break key generates a different signal than CTRL+C.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brendan</title>
		<link>http://stacyprowell.com/blog/2009/03/30/trapping-ctrlc-in-python/comment-page-1/#comment-4</link>
		<dc:creator>Brendan</dc:creator>
		<pubDate>Tue, 31 Mar 2009 20:27:45 +0000</pubDate>
		<guid isPermaLink="false">http://stacyprowell.com/blog/?p=123#comment-4</guid>
		<description>You should add a thing to let you specify a callback when the user hits ctrl-c. As long as the callback returns, there&#039;s no difference.</description>
		<content:encoded><![CDATA[<p>You should add a thing to let you specify a callback when the user hits ctrl-c. As long as the callback returns, there&#8217;s no difference.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
