<?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://www.simcn.com/tag/python/feed" rel="self" type="application/rss+xml" />
	<link>http://www.simcn.com</link>
	<description>网站开发, 前端开发, 高性能前端开发</description>
	<lastBuildDate>Thu, 03 Nov 2011 02:08:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>python合并多个TXT</title>
		<link>http://www.simcn.com/python-merge-txt</link>
		<comments>http://www.simcn.com/python-merge-txt#comments</comments>
		<pubDate>Tue, 18 May 2010 13:57:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[默认分类]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[txt]]></category>
		<category><![CDATA[合并]]></category>

		<guid isPermaLink="false">http://www.simcn.com/2010/05/python%e5%90%88%e5%b9%b6%e5%a4%9a%e4%b8%aatxt/</guid>
		<description><![CDATA[今天用PYTHON采集多个TXT的URL需要合并起来。 总共有2K多条记录，人工合并太累了，写了这个合并程序，功能很简单，代码也很简单 #! /usr/bin/env python #coding=utf-8 if __name__ == "__main__": data = '' for n in range(1, 2835): filename = 'qidian'+str(n)+'.txt' data += file(filename).read() file(filename).close() wFile = file('all.txt','w') print >> wFile, data wFile.close()]]></description>
			<content:encoded><![CDATA[<p>今天用PYTHON采集多个TXT的URL需要合并起来。 总共有2K多条记录，人工合并太累了，写了这个合并程序，功能很简单，代码也很简单</p>
<pre class="brush:python">
#! /usr/bin/env python
#coding=utf-8

if __name__ == "__main__":

    data = ''
    for n in range(1, 2835):
        filename = 'qidian'+str(n)+'.txt'
        data += file(filename).read()
        file(filename).close()

    wFile = file('all.txt','w')
    print >> wFile, data
    wFile.close()
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.simcn.com/python-merge-txt/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>改变系统hosts的软件(PYTHON写的)</title>
		<link>http://www.simcn.com/hosts_change_python_windows7</link>
		<comments>http://www.simcn.com/hosts_change_python_windows7#comments</comments>
		<pubDate>Thu, 07 Jan 2010 00:57:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[默认分类]]></category>
		<category><![CDATA[hosts]]></category>
		<category><![CDATA[py2exe]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[windows7]]></category>
		<category><![CDATA[wxpython]]></category>

		<guid isPermaLink="false">http://www.simcn.com/?p=218</guid>
		<description><![CDATA[做前端，测试，程序开发需要不停的转换系统hosts文件。 用批处理与EDIT在集成测试时比较麻烦，所以写下这个软件 FOR XP 改变系统hosts工具-XP FOR WIN7 改变系统hosts工具-windows7 其他平台没有试过。 使用 python2.5 + wxpython2.8 + py2exe 功能比较简单。]]></description>
			<content:encoded><![CDATA[<p>做前端，测试，程序开发需要不停的转换系统hosts文件。<br />
用批处理与EDIT在集成测试时比较麻烦，所以写下这个软件</p>
<p>FOR XP<br />
<a href="http://www.box.net/shared/ety4arhp97">改变系统hosts工具-XP</a><br />
FOR WIN7<br />
<a href="http://www.box.net/shared/gliymjrikz">改变系统hosts工具-windows7</a></p>
<p>其他平台没有试过。<br />
使用 python2.5 + wxpython2.8 + py2exe<br />
功能比较简单。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simcn.com/hosts_change_python_windows7/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>python改变系统hosts</title>
		<link>http://www.simcn.com/python-chang-system-hosts</link>
		<comments>http://www.simcn.com/python-chang-system-hosts#comments</comments>
		<pubDate>Mon, 02 Nov 2009 10:22:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[后端技术]]></category>
		<category><![CDATA[hosts]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[system]]></category>

		<guid isPermaLink="false">http://www.simcn.com/?p=213</guid>
		<description><![CDATA[因工作需要一直修改系统hosts，以切换内网，外网，其他测试服务器。 天天改比较麻烦写了这个小工具比较简单， 打包成EXE后比较大(不过自己用的东西就没啥讲究了) 贴上源代码 #-* coding:GBK *- import os import wx def create(parent): return Frame1(parent) # assign ID numbers [wxID_FRAME1, wxID_FRAME1BUTTON1, wxID_FRAME1BUTTON2, wxID_FRAME1LISTBOX1, ] = [wx.NewId() for _init_ctrls in range(4)] class Frame1(wx.Frame): def _init_ctrls(self, prnt): # BOA generated methods wx.Frame.__init__(self, id=wxID_FRAME1, name='', parent=prnt, pos=wx.Point(400, 400), size=wx.Size(500, 400), style=wx.DEFAULT_FRAME_STYLE, title='改系统hosts，需要把要修改的hosts文件放在hosts目录下面') self.SetClientSize(wx.Size(750, 300)) self.listBox1 = wx.ListBox(choices=[], id=wxID_FRAME1LISTBOX1, [...]]]></description>
			<content:encoded><![CDATA[<p>因工作需要一直修改系统hosts，以切换内网，外网，其他测试服务器。<br />
天天改比较麻烦写了这个小工具比较简单， 打包成EXE后比较大(不过自己用的东西就没啥讲究了)</p>
<p>贴上源代码</p>
<pre name="code" class="brush:python">
#-* coding:GBK *-
import os
import wx

def create(parent):
    return Frame1(parent)

# assign ID numbers
[wxID_FRAME1, wxID_FRAME1BUTTON1, wxID_FRAME1BUTTON2, wxID_FRAME1LISTBOX1,
] = [wx.NewId() for _init_ctrls in range(4)]

class Frame1(wx.Frame):
    def _init_ctrls(self, prnt):
        # BOA generated methods
        wx.Frame.__init__(self, id=wxID_FRAME1, name='', parent=prnt,
              pos=wx.Point(400, 400), size=wx.Size(500, 400),
              style=wx.DEFAULT_FRAME_STYLE, title='改系统hosts，需要把要修改的hosts文件放在hosts目录下面')

        self.SetClientSize(wx.Size(750, 300))

        self.listBox1 = wx.ListBox(choices=[], id=wxID_FRAME1LISTBOX1,
              name='listBox1', parent=self, pos=wx.Point(10, 10),
              size=wx.Size(200, 240), style=0)

        self.t1 = wx.TextCtrl(self, -1,"",size=(520, 280), pos=wx.Point(220, 10),style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

        '''列表目录中所有文件'''
        for i in os.listdir('./hosts/'):
            self.listBox1.Append(i)   

        self.listBox1.Bind(wx.EVT_LISTBOX, self.OnListBox1Listbox,
              id=wxID_FRAME1LISTBOX1)            

        self.button2 = wx.Button(id=wxID_FRAME1BUTTON2, label='改写系统hosts',
              name='button2', parent=self, pos=wx.Point(10, 260),
              size=wx.Size(200, 30), style=0)

        self.button2.Bind(wx.EVT_BUTTON, self.OnButton2Button,
              id=wxID_FRAME1BUTTON2)

    def __init__(self, parent):
        self._init_ctrls(parent)

    def OnListBox1Listbox(self, event):
        selName = './hosts/' + self.listBox1.GetStringSelection()
        #self.SetTitle(selName)       

        f = open(selName, "r+")
        try:
            all_the_text = f.read( )
        finally:
            f.close()
        self.t1.Clear()
        self.t1.write(all_the_text)        

    def OnButton2Button(self, event):
        x = os.getenv('WINDIR')+"\system32\drivers\etc\hosts"
        v = self.t1.GetValue();
        v = v.encode('gb2312')
        f = open(x, 'w')
        f.writelines(v)
        f.close( )        

#--------------- end of class Frame1 --------------------

# program entry point ...
if __name__ == '__main__':
    app = wx.PySimpleApp()
    wx.InitAllImageHandlers()
    frame = create(None)
    frame.Show()

    app.MainLoop()
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.simcn.com/python-chang-system-hosts/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>C#和Java是工作日语言，Python和Ruby是周末语言</title>
		<link>http://www.simcn.com/c%e5%92%8cjava%e6%98%af%e5%b7%a5%e4%bd%9c%e6%97%a5%e8%af%ad%e8%a8%80%ef%bc%8cpython%e5%92%8cruby%e6%98%af%e5%91%a8%e6%9c%ab%e8%af%ad%e8%a8%80</link>
		<comments>http://www.simcn.com/c%e5%92%8cjava%e6%98%af%e5%b7%a5%e4%bd%9c%e6%97%a5%e8%af%ad%e8%a8%80%ef%bc%8cpython%e5%92%8cruby%e6%98%af%e5%91%a8%e6%9c%ab%e8%af%ad%e8%a8%80#comments</comments>
		<pubDate>Tue, 18 Aug 2009 14:19:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[默认分类]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.simcn.com/2009/08/c%e5%92%8cjava%e6%98%af%e5%b7%a5%e4%bd%9c%e6%97%a5%e8%af%ad%e8%a8%80%ef%bc%8cpython%e5%92%8cruby%e6%98%af%e5%91%a8%e6%9c%ab%e8%af%ad%e8%a8%80/</guid>
		<description><![CDATA[Stack Overflow是很受欢迎的程序设计问题协作式问答社区，当程序员在编程中遇到问题，他们会在Stack Overflow上发帖讨论，这些问题会涉及到各种语言。于是便提出一个有趣的问题：在工作日程序员通常问何种语言的问题较多，周末呢？ 使用Stack Overflow的存档，Dan Lorenc分析了一周内程序语言的活跃性。结果发现：到了周末询问Python和Ruby相关问题的数量上升，而C#和Java的数量下降。这意味着程序员周末在个人项目上使用较多的是Python和Ruby语言，可能是因为它们用起来让人愉快。下次当Boss让你选择工作语言时，你或许可以向他展示这个结果。 source:solidot]]></description>
			<content:encoded><![CDATA[<p>Stack Overflow是很受欢迎的程序设计问题协作式问答社区，当程序员在编程中遇到问题，他们会在Stack Overflow上发帖讨论，这些问题会涉及到各种语言。于是便提出一个有趣的问题：在工作日程序员通常问何种语言的问题较多，周末呢？ </p>
<p>使用Stack Overflow的存档，Dan Lorenc分析了一周内程序语言的活跃性。结果发现：到了周末询问Python和Ruby相关问题的数量上升，而C#和Java的数量下降。这意味着程序员周末在个人项目上使用较多的是Python和Ruby语言，可能是因为它们用起来让人愉快。下次当Boss让你选择工作语言时，你或许可以向他展示这个结果。  </p>
<p>source:solidot</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simcn.com/c%e5%92%8cjava%e6%98%af%e5%b7%a5%e4%bd%9c%e6%97%a5%e8%af%ad%e8%a8%80%ef%bc%8cpython%e5%92%8cruby%e6%98%af%e5%91%a8%e6%9c%ab%e8%af%ad%e8%a8%80/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>我的第一个python作品</title>
		<link>http://www.simcn.com/python-no-001</link>
		<comments>http://www.simcn.com/python-no-001#comments</comments>
		<pubDate>Wed, 05 Aug 2009 10:12:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[默认分类]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.simcn.com/?p=170</guid>
		<description><![CDATA[import os base = raw_input('base address[d:/svn/]') if base=='' : base = 'd:/svn/' module = raw_input('Module Name[search]') if module =='' : module = 'search' Version = raw_input('Version[v1]') if Version == '' : Version = 'v1' _t = ['css','images','html','js','page'] _d = ['1y','1m','1w','1d'] base = string.replace(base,'\\','\/') base = base + '\/' for i in _t : if i'html' [...]]]></description>
			<content:encoded><![CDATA[<pre name='code' class="brush:python">
import os

base = raw_input('base address[d:/svn/]')
if base=='' :
    base = 'd:/svn/'

module = raw_input('Module Name[search]')
if module =='' :
    module = 'search'

Version = raw_input('Version[v1]')
if Version == '' :
    Version = 'v1'

_t = ['css','images','html','js','page']
_d = ['1y','1m','1w','1d']

base = string.replace(base,'\\','\/')
base = base + '\/'   

for i in _t :
    if i<>'html' :
        for j in _d:
            url = base + i + '/' + module + '/' + Version + '/' + j + '/'
            print url+ '->ok'
            if os.path.exists(url)== False :
                os.makedirs(url)

raw_input('done')
</pre>
<p>主要是用来生成文件目录用了.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simcn.com/python-no-001/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

