<?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>IT公司面试手册 &#187; Python</title>
	<atom:link href="http://www.mianwww.com/html/category/it-interview/python/feed" rel="self" type="application/rss+xml" />
	<link>http://www.mianwww.com</link>
	<description></description>
	<lastBuildDate>Wed, 08 Feb 2012 11:48:28 +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面试题集</title>
		<link>http://www.mianwww.com/html/2011/06/9787.html</link>
		<comments>http://www.mianwww.com/html/2011/06/9787.html#comments</comments>
		<pubDate>Tue, 21 Jun 2011 11:16:59 +0000</pubDate>
		<dc:creator>jim.jin</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.mianwww.com/?p=9787</guid>
		<description><![CDATA[1：Python如何实现单例模式？ Python有两种方式可以实现单例模式，下面两个例子使用了不同的方式实现单例模式： 1. class Singleton(type): def __init__(cls, name, bases, dict): super(Singleton, cls).__init__(name, bases, dict) cls.instance = None def __call__(cls, *args, **kw): if cls.instance is None: cls.instance = super(Singleton, cls).__call__(*args, **kw) return cls.instance class MyClass(object): __metaclass__ = Singleton print MyClass() print MyClass() 2. 使用decorator来实现单例模式 def singleton(cls): instances = {} def getinstance(): if cls not in instances: [...]]]></description>
		<wfw:commentRss>http://www.mianwww.com/html/2011/06/9787.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python如何实现单例模式？</title>
		<link>http://www.mianwww.com/html/2010/02/7239.html</link>
		<comments>http://www.mianwww.com/html/2010/02/7239.html#comments</comments>
		<pubDate>Mon, 08 Feb 2010 09:13:15 +0000</pubDate>
		<dc:creator>jim.jin</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.mianwww.com/?p=7239</guid>
		<description><![CDATA[Python有两种方式可以实现单例模式，下面两个例子使用了不同的方式实现单例模式： 1. class Singleton(type): def __init__(cls, name, bases, dict): super(Singleton, cls).__init__(name, bases, dict) cls.instance = None def __call__(cls, *args, **kw): if cls.instance is None: cls.instance = super(Singleton, cls).__call__(*args, **kw) return cls.instance class MyClass(object): __metaclass__ = Singleton print MyClass() print MyClass() 2. 使用decorator来实现单例模式 def singleton(cls): instances = {} def getinstance(): if cls not in instances: instances[cls] [...]]]></description>
		<wfw:commentRss>http://www.mianwww.com/html/2010/02/7239.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>什么是lambda函数？</title>
		<link>http://www.mianwww.com/html/2009/11/6068.html</link>
		<comments>http://www.mianwww.com/html/2009/11/6068.html#comments</comments>
		<pubDate>Thu, 26 Nov 2009 11:35:47 +0000</pubDate>
		<dc:creator>jim.jin</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.mianwww.com/?p=6068</guid>
		<description><![CDATA[Python允许你定义一种单行的小函数。定义lambda函数的形式如下：labmda 参数：表达式lambda函数默认返回表达式的值。你也可以将其赋值给一个变量。lambda函数可以接受任意个参数，包括可选参数，但是表达式只有一个： &#62;&#62;&#62; g = lambda x, y: x*y &#62;&#62;&#62; g(3,4) 12 &#62;&#62;&#62; g = lambda x, y=0, z=0: x+y+z &#62;&#62;&#62; g(1) 1 &#62;&#62;&#62; g(3, 4, 7) 14 也能够直接使用lambda函数，不把它赋值给变量： &#62;&#62;&#62; (lambda x,y=0,z=0:x+y+z)(3,5,6) 14 如果你的函数非常简单，只有一个表达式，不包含命令，可以考虑lambda函数。否则，你还是定义函数才对，毕竟函数没有这么多限制。]]></description>
		<wfw:commentRss>http://www.mianwww.com/html/2009/11/6068.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python是如何进行类型转换的？</title>
		<link>http://www.mianwww.com/html/2009/11/6066.html</link>
		<comments>http://www.mianwww.com/html/2009/11/6066.html#comments</comments>
		<pubDate>Thu, 26 Nov 2009 11:34:39 +0000</pubDate>
		<dc:creator>jim.jin</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.mianwww.com/?p=6066</guid>
		<description><![CDATA[Python提供了将变量或值从一种类型转换成另一种类型的内置函数。int函数能够将符合数学格式数字型字符串转换成整数。否则，返回错误信息。 &#62;&#62;&#62; int(&#8220;34&#8243;) 34 &#62;&#62;&#62; int(&#8220;1234ab&#8221;) #不能转换成整数 ValueError: invalid literal for int(): 1234ab 函数int也能够把浮点数转换成整数，但浮点数的小数部分被截去。 &#62;&#62;&#62; int(34.1234) 34 &#62;&#62;&#62; int(-2.46) -2 函数°oat将整数和字符串转换成浮点数： &#62;&#62;&#62; float(&#8220;12&#8243;) 12.0 &#62;&#62;&#62; float(&#8220;1.111111&#8243;) 1.111111 函数str将数字转换成字符： &#62;&#62;&#62; str(98) &#8217;98&#8242; &#62;&#62;&#62; str(&#8220;76.765&#8243;) &#8217;76.765&#8242; 整数1和浮点数1.0在python中是不同的。虽然它们的值相等的，但却属于不同的类型。这两个数在计算机的存储形式也是不一样。]]></description>
		<wfw:commentRss>http://www.mianwww.com/html/2009/11/6066.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python如何定义一个函数</title>
		<link>http://www.mianwww.com/html/2009/11/6064.html</link>
		<comments>http://www.mianwww.com/html/2009/11/6064.html#comments</comments>
		<pubDate>Thu, 26 Nov 2009 11:33:02 +0000</pubDate>
		<dc:creator>jim.jin</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.mianwww.com/?p=6064</guid>
		<description><![CDATA[函数的定义形式如 下： def &#60;name&#62;(arg1, arg2,&#8230; argN): &#60;statements&#62; 函数的名字也必须以字母开头，可以包括下划线“ ”,但不能把Python的 关键字定义成函数的名字。函数内的语句数量是任意的，每个语句至少有 一个空格的缩进，以表示此语句属于这个函数的。缩进结束的地方，函数 自然结束。 下面定义了一个两个数相加的函数： &#62;&#62;&#62; def add(p1, p2): print p1, &#8220;+&#8221;, p2, &#8220;=&#8221;, p1+p2 &#62;&#62;&#62; add(1, 2) 1 + 2 = 3 函数的目的是把一些复杂的操作隐藏，来简化程序的结构，使其容易 阅读。函数在调用前，必须先定义。也可以在一个函数内部定义函数，内 部函数只有在外部函数调用时才能够被执行。程序调用函数时，转到函数 内部执行函数内部的语句，函数执行完毕后，返回到它离开程序的地方， 执行程序的下一条语句。]]></description>
		<wfw:commentRss>http://www.mianwww.com/html/2009/11/6064.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python面试题：Python是如何进行内存管理的？</title>
		<link>http://www.mianwww.com/html/2009/08/3625.html</link>
		<comments>http://www.mianwww.com/html/2009/08/3625.html#comments</comments>
		<pubDate>Mon, 24 Aug 2009 06:29:18 +0000</pubDate>
		<dc:creator>jim.jin</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.mianwww.com/?p=3625</guid>
		<description><![CDATA[Python的内存管理是由Python得解释器负责的，开发人员可以从内存管理事务中解放出来，致力于应用程序的开发，这样就使得开发的程序错误更少，程序更健壮，开发周期更短。]]></description>
		<wfw:commentRss>http://www.mianwww.com/html/2009/08/3625.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何反序的迭代一个序列？how do I iterate over a sequence in reverse order</title>
		<link>http://www.mianwww.com/html/2009/08/3615.html</link>
		<comments>http://www.mianwww.com/html/2009/08/3615.html#comments</comments>
		<pubDate>Sun, 23 Aug 2009 15:05:19 +0000</pubDate>
		<dc:creator>jim.jin</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.mianwww.com/?p=3615</guid>
		<description><![CDATA[如果是一个list, 最快的解决方案是： list.reverse() try: for x in list: &#8220;do something with x&#8221; finally: list.reverse() 如果不是list, 最通用但是稍慢的解决方案是： for i in range(len(sequence)-1, -1, -1): x = sequence[i] &#60;do something with x&#62;]]></description>
		<wfw:commentRss>http://www.mianwww.com/html/2009/08/3615.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Python里面如何实现tuple和list的转换？</title>
		<link>http://www.mianwww.com/html/2009/08/3613.html</link>
		<comments>http://www.mianwww.com/html/2009/08/3613.html#comments</comments>
		<pubDate>Sun, 23 Aug 2009 15:01:34 +0000</pubDate>
		<dc:creator>jim.jin</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.mianwww.com/?p=3613</guid>
		<description><![CDATA[函数tuple(seq)可以把所有可迭代的(iterable)序列转换成一个tuple, 元素不变，排序也不变。 例如，tuple([1,2,3])返回(1,2,3), tuple(&#8216;abc&#8217;)返回(&#8216;a&#8217;.'b&#8217;,'c&#8217;).如果参数已经是一个tuple的话，函数不做任何拷贝而直接返回原来的对象，所以在不确定对象是不是tuple的时候来调用tuple()函数也不是很耗费的。 函数list(seq)可以把所有的序列和可迭代的对象转换成一个list,元素不变，排序也不变。 例如 list([1,2,3])返回(1,2,3), list(&#8216;abc&#8217;)返回['a', 'b', 'c']。如果参数是一个list, 她会像set[:]一样做一个拷贝]]></description>
		<wfw:commentRss>http://www.mianwww.com/html/2009/08/3613.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python面试题：请写出一段Python代码实现删除一个list里面的重复元素</title>
		<link>http://www.mianwww.com/html/2009/08/3610.html</link>
		<comments>http://www.mianwww.com/html/2009/08/3610.html#comments</comments>
		<pubDate>Sun, 23 Aug 2009 14:51:49 +0000</pubDate>
		<dc:creator>jim.jin</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.mianwww.com/?p=3610</guid>
		<description><![CDATA[可以先把list重新排序，然后从list的最后开始扫描，代码如下： if List: List.sort() last = List[-1] for i in range(len(List)-2, -1, -1): if last==List[i]: del List[i] else: last=List[i]]]></description>
		<wfw:commentRss>http://www.mianwww.com/html/2009/08/3610.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Python文件操作的面试题</title>
		<link>http://www.mianwww.com/html/2009/08/3607.html</link>
		<comments>http://www.mianwww.com/html/2009/08/3607.html#comments</comments>
		<pubDate>Sun, 23 Aug 2009 14:45:02 +0000</pubDate>
		<dc:creator>jim.jin</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.mianwww.com/?p=3607</guid>
		<description><![CDATA[1. 如何用Python删除一个文件？ 使用os.remove(filename)或者os.unlink(filename); 2. Python如何copy一个文件？ shutil模块有一个copyfile函数可以实现文件拷贝]]></description>
		<wfw:commentRss>http://www.mianwww.com/html/2009/08/3607.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

