<?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>「開發wxPython的利器 : PyCrust」的迴響</title>
	<atom:link href="http://blog.ez2learn.com/2009/06/17/nice-development-tool-pycrust/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ez2learn.com/2009/06/17/nice-development-tool-pycrust/</link>
	<description>Victor&#039;s個人部落格，關於程式設計與小提琴</description>
	<lastBuildDate>Fri, 10 Feb 2012 08:55:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>由：Hua</title>
		<link>http://blog.ez2learn.com/2009/06/17/nice-development-tool-pycrust/comment-page-1/#comment-647</link>
		<dc:creator>Hua</dc:creator>
		<pubDate>Sun, 05 Jul 2009 04:06:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ez2learn.com/?p=592#comment-647</guid>
		<description>我發現在pyShell的interprter中, 無法以thread的方式獨立出一個程序來實現GUI的response.
例如以下程式:
from time import sleep
def myloop(sleeptime):
    for i in xrange(sleeptime):
        sleep(1)
        print &#039;Hi&#039;
    
&gt;&gt;&gt; myloop(3)
Hi
Hi
Hi
&gt;&gt;&gt;

執行時甚至連&#039;Hi&#039;都一次顯示, 而不是sleep(1)之後print &#039;Hi&#039;. 我的推測是pyShell的&quot;self.more = self.interp.push(command)&quot;佔據了VM, 它要把&quot;command&quot;都執行完畢才return.</description>
		<content:encoded><![CDATA[<p>我發現在pyShell的interprter中, 無法以thread的方式獨立出一個程序來實現GUI的response.<br />
例如以下程式:<br />
from time import sleep<br />
def myloop(sleeptime):<br />
    for i in xrange(sleeptime):<br />
        sleep(1)<br />
        print &#8216;Hi&#8217;</p>
<p>&gt;&gt;&gt; myloop(3)<br />
Hi<br />
Hi<br />
Hi<br />
&gt;&gt;&gt;</p>
<p>執行時甚至連&#8217;Hi&#8217;都一次顯示, 而不是sleep(1)之後print &#8216;Hi&#8217;. 我的推測是pyShell的"self.more = self.interp.push(command)"佔據了VM, 它要把"command"都執行完畢才return.</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：Hua</title>
		<link>http://blog.ez2learn.com/2009/06/17/nice-development-tool-pycrust/comment-page-1/#comment-614</link>
		<dc:creator>Hua</dc:creator>
		<pubDate>Thu, 18 Jun 2009 04:08:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ez2learn.com/?p=592#comment-614</guid>
		<description>pyCrust中間的console是pyShell, 是個wxStyledTextCtrl的類別, 可以嵌入wxpython成為一個現有的script console介面, 做tool類型的app很好用.

有一個pyShell下的問題, 例如下列程式碼:
&quot;&quot;&quot;
for i in range(10):
    pass
print &#039;end&#039;
&quot;&quot;&quot;
執行結果為:
&quot;&quot;&quot;
  File &quot;&quot;, line 3
    print &#039;end&#039;
        ^
SyntaxError: invalid syntax
&quot;&quot;&quot;
pyShell它內建的parsing機制似乎不接受兩行以上的敘述, 這導致shell.runfile(filename)也會無法執行兩行以上的script. 解法為使用shell.run執行execfile.
shell.run(r&quot;execfile(r&#039;%s&#039;)&quot;%(filename), verbose=False)</description>
		<content:encoded><![CDATA[<p>pyCrust中間的console是pyShell, 是個wxStyledTextCtrl的類別, 可以嵌入wxpython成為一個現有的script console介面, 做tool類型的app很好用.</p>
<p>有一個pyShell下的問題, 例如下列程式碼:<br />
"""<br />
for i in range(10):<br />
    pass<br />
print &#8216;end&#8217;<br />
"""<br />
執行結果為:<br />
"""<br />
  File "", line 3<br />
    print &#8216;end&#8217;<br />
        ^<br />
SyntaxError: invalid syntax<br />
"""<br />
pyShell它內建的parsing機制似乎不接受兩行以上的敘述, 這導致shell.runfile(filename)也會無法執行兩行以上的script. 解法為使用shell.run執行execfile.<br />
shell.run(r"execfile(r&#8217;%s&#8217;)"%(filename), verbose=False)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

