<?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>潔靜精微 &#187; python</title>
	<atom:link href="http://julabs.me/blog/tags/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://julabs.me/blog</link>
	<description>想努力创造完美的东西，必须具备心灵的纯洁，同时富于宗教精神。</description>
	<lastBuildDate>Wed, 18 Jan 2012 06:34:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>解决“Unable to find vcvarsall.bat”错误</title>
		<link>http://julabs.me/blog/python/unable-to-find-vcvarsall-bat/</link>
		<comments>http://julabs.me/blog/python/unable-to-find-vcvarsall-bat/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 07:23:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[error]]></category>

		<guid isPermaLink="false">http://julabs.me/blog/?p=221</guid>
		<description><![CDATA[今天在安装PyAMF时老是发生Unable to find vcvarsall.bat的错误，上网找了一下，在eddsn找到了“Unable to find vcvarsall.bat” error when trying to install rdflib这么一篇文章，解决了问题。方法如下： 首先安装MinGW，在MinGW的安装目录下找到bin的文件夹，找到mingw32-make.exe，复制一份更名为make.exe； 把MinGW的路径添加到环境变量path中，比如我把MinGW安装到D:\MinGW\中，就把D:\MinGW\bin添加到path中； 打开命令行窗口，在命令行窗口中进入到要安装代码的目录下； 输入如下命令就可以安装了。 setup.py install build --compiler=mingw32]]></description>
			<content:encoded><![CDATA[<p>今天在安装<a href="http://pyamf.org/" target="_blank">PyAMF</a>时老是发生<strong>Unable to find vcvarsall.bat</strong>的错误，上网找了一下，在<a href="http://blog.eddsn.com/" target="_blank">eddsn</a>找到了<a href="http://blog.eddsn.com/2010/05/unable-to-find-vcvarsall-bat/" target="_blank">“Unable to find vcvarsall.bat” error when trying to install rdflib</a>这么一篇文章，解决了问题。方法如下：</p>
<ol>
<li>首先安装<a href="http://sourceforge.net/projects/mingw/files/" target="_blank">MinGW</a>，在<a href="http://sourceforge.net/projects/mingw/files/" target="_blank">MinGW</a>的安装目录下找到<strong>bin</strong>的文件夹，找到<strong>mingw32-make.exe</strong>，复制一份更名为<strong>make.exe</strong>；</li>
<li>把<a href="http://sourceforge.net/projects/mingw/files/" target="_blank">MinGW</a>的路径添加到环境变量<strong>path</strong>中，比如我把<a href="http://sourceforge.net/projects/mingw/files/" target="_blank">MinGW</a>安装到<strong>D:\MinGW\</strong>中，就把<strong>D:\MinGW\bin</strong>添加到<strong>path</strong>中；</li>
<li>打开命令行窗口，在命令行窗口中进入到要安装代码的目录下；</li>
<li>输入如下命令就可以安装了。</li>
</ol>
<pre><code class="dos">setup.py install build --compiler=mingw32
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://julabs.me/blog/python/unable-to-find-vcvarsall-bat/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>wxPython的树形目录控件</title>
		<link>http://julabs.me/blog/python/tree-directory-in-wxpython/</link>
		<comments>http://julabs.me/blog/python/tree-directory-in-wxpython/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 09:42:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[tree]]></category>
		<category><![CDATA[wxpython]]></category>
		<category><![CDATA[树形]]></category>
		<category><![CDATA[目录]]></category>

		<guid isPermaLink="false">http://julabs.me/blog/?p=99</guid>
		<description><![CDATA[自从开始学wxPython以来就一直想找到一个树形目录控件，但却一直没找到，我还以为wxPython根本就没有提供这样的控件。前几天无意中在wxPython演示文件里找到了这个控件，欣喜若狂，小研究了下，编写了一个小型的演示，可以输出所激活文件的路径名。代码如下： #!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2009-10-17 @author: jon.ju@msn.com ''' import wx import os import sys class myApp(wx.App): def OnInit(self): frame=wx.Frame(parent=None,title='GenericDirCtrl') panel=wx.Panel(frame,-1) # 目录控件 self.dir1 = wx.GenericDirCtrl(panel, -1,dir="E:", size=(200,225), style=0) # 目录控件中的树形控件 self._tree=self.dir1.GetTreeCtrl() # 绑定激活文件行为，如双击文件时 &#8230; <a href="http://julabs.me/blog/python/tree-directory-in-wxpython/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>自从开始学<a href="http://www.wxpython.org/" target="_blank">wxPython</a>以来就一直想找到一个树形目录控件，但却一直没找到，我还以为<a href="http://www.wxpython.org/" target="_blank">wxPython</a>根本就没有提供这样的控件。前几天无意中在<a href="http://www.wxpython.org/" target="_blank">wxPython</a>演示文件里找到了这个控件，欣喜若狂，小研究了下，编写了一个小型的演示，可以输出所激活文件的路径名。代码如下：</p>
<pre><code class="python">#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 2009-10-17

@author: jon.ju@msn.com
'''
import wx
import os
import sys

class myApp(wx.App):

	def OnInit(self):
		frame=wx.Frame(parent=None,title='GenericDirCtrl')
		panel=wx.Panel(frame,-1)

		# 目录控件
		self.dir1 = wx.GenericDirCtrl(panel, -1,dir="E:", size=(200,225), style=0)

		# 目录控件中的树形控件
		self._tree=self.dir1.GetTreeCtrl()

		# 绑定激活文件行为，如双击文件时
		self.dir1.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnOpen)
		frame.Show()
		return True

	# 双击文件时显示文件路径
	def OnOpen(self,evt):
		# 如果对象是目录，则打印'这是目录'
		if os.path.isdir(self.dir1.GetPath()):
			print '这是目录'
			evt.Skip()
			return

		# 如果对象是文件，则显示文件目录
		else:
			print self.dir1.GetFilePath().encode(sys.getfilesystemencoding())

if __name__=='__main__':
	app=myApp(False)
	app.MainLoop()
</code></pre>
<p>这里所用到的树形目录控件就是<strong>GenericDirCtrl</strong>，它继承自<a href="http://www.wxpython.org/" target="_blank">wxPython</a>的树控件，所以树控件的属性和行为，<strong>GenericDirCtrl</strong>都是可以直接使用的。</p>
]]></content:encoded>
			<wfw:commentRss>http://julabs.me/blog/python/tree-directory-in-wxpython/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>python中文乱码</title>
		<link>http://julabs.me/blog/python/python-chinese/</link>
		<comments>http://julabs.me/blog/python/python-chinese/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 09:05:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[乱码]]></category>

		<guid isPermaLink="false">http://julabs.me/blog/?p=73</guid>
		<description><![CDATA[虽然python的print命令可以用加“# -*- coding: cp936 -*-”方式输出中文，但在wxPython里如果用这种方法做按钮标题等仍然是乱码，后来找到了一个方法：在源文件头部的第一行或第二行加上源文件的文件编码格式就可以了，如下： # coding=&#60;encoding name&#62; 或： #!/usr/bin/python # -*- coding: &#60;encoding name&#62; -*- 其中的“&#60;encoding name&#62;”就是文件编码格式，如我用的格式是utf-8的，我的前两行是： #!/bin/env python # -*- coding: utf-8 -*-]]></description>
			<content:encoded><![CDATA[<p>虽然python的print命令可以用加“<code># -*- coding: cp936 -*-</code>”方式输出中文，但在wxPython里如果用这种方法做按钮标题等仍然是乱码，后来找到了一个方法：在源文件头部的第一行或第二行加上源文件的文件编码格式就可以了，如下：</p>
<pre><code class="python"># coding=&lt;encoding name&gt;</code></pre>
<p>或：</p>
<pre><code class="python">#!/usr/bin/python
# -*- coding: &lt;encoding name&gt; -*-
</code></pre>
<p>其中的“<code>&lt;encoding name&gt;</code>”就是文件编码格式，如我用的格式是utf-8的，我的前两行是：</p>
<pre><code class="python">#!/bin/env python
# -*- coding: utf-8 -*-
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://julabs.me/blog/python/python-chinese/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

