id: 6f299ace7a3a4a268d50e0dc8e88c1ce
parent_id: 
item_type: 1
item_id: fba7ebbed710424689420d9ffe79faaa
item_updated_time: 1764345576933
title_diff: "[{\"diffs\":[[1,\"Python3.x和Python2.x的区别\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":22}]"
body_diff: "[{\"diffs\":[[1,\"<html>\\\r\\\n<head>\\\r\\\n  <title>Python3.x和Python2.x的区别</title>\\\r\\\n  <basefont face=\\\"微软雅黑\\\" size=\\\"2\\\" />\\\r\\\n  <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;charset=utf-8\\\" />\\\r\\\n  <meta name=\\\"exporter-version\\\" content=\\\"YXBJ Windows/608924 (zh-CN, DDL); Windows/10.0.0 (Win64); EDAMVersion=V2;\\\"/>\\\r\\\n  <meta name=\\\"application-data:2525275\\\" content=\\\"6692893/s30/fdde0827-6e6e-45a0-9808-23d6fb2ab500/app.yinxiang.com\\\"/>\\\r\\\n  <style>\\\r\\\n\\tbody, td {\\\r\\\n\\t  font-family: 微软雅黑;\\\r\\\n\\t  font-size: 12pt;\\\r\\\n\\t}\\\r\\\n  </style>\\\r\\\n</head>\\\r\\\n<body>\\\r\\\n<a name=\\\"13436\\\"></a>\\\r\\\n<h1>Python3.x和Python2.x的区别</h1>\\\r\\\n\\\r\\\n<div><span><br/><div style=\\\"font-size: 16px\\\"><div><div style=\\\"font-family:Verdana, Arial, Helvetica, sans-serif;background-image:url(http://www.cnblogs.com/skins/iMetro_HD/images/background.jpg);background-attachment:fixed;background-repeat:no-repeat;background-color:rgb(245, 245, 245);\\\"><div style=\\\"font-family:Verdana, Arial, Helvetica, sans-serif;font-size:12px;color:rgb(0, 0, 0);word-wrap:break-word;box-shadow:black 0px 0px 25px;line-height:1.5;background-color:rgb(255, 255, 255);\\\"><div style=\\\"overflow:auto;\\\"><div><div><div><div style=\\\"background-color:rgb(245, 245, 245);\\\">\\\n\\t\\t<h1 style=\\\"margin:0px;padding:0px;font-size:100%;font-weight:normal;margin-bottom:10px;padding-left:15px;padding-right:15px;background-image:url(http://www.cnblogs.com/skins/iMetro_HD/images/logo.png);background-position:-10px 0px;background-repeat:repeat-y;\\\">\\\n\\t\\t\\t<a href=\\\"http://www.cnblogs.com/likebeta/archive/2011/12/13/2285964.html\\\" style=\\\"margin:0px;padding:0px;font-size:200%;color:rgb(0, 0, 0);text-decoration:none;\\\">Python3.x和Python2.x的区别</a>\\\n\\t\\t</h1>\\\n\\t\\t<div style=\\\"margin:0px;padding:0px;clear:both;\\\"></div>\\\n\\t\\t<div style=\\\"margin:0px;padding:0px;font-size:116%;padding-left:15px;padding-right:15px;margin-bottom:5px;\\\">\\\n\\t\\t\\t<div style=\\\"margin:0px;padding:0px;margin-bottom:30px;overflow:auto;\\\"><p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"><strong style=\\\"margin:0px;padding:0px;\\\">这个星期开始学习Python了，因为看的书都是基于Python2.x，而且我安装的是Python3.1，所以书上写的地方好多都不适用于Python3.1，特意在Google上search了一下3.x和2.x的区别。特此在自己的空间中记录一下，以备以后查找方便，也可以分享给想学习Python的friends.</strong></p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"> </p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"><strong style=\\\"margin:0px;padding:0px;\\\">1.性能</strong> <br style=\\\"margin:0px;padding:0px;\\\"/>Py3.0运行 pystone benchmark的速度比Py2.5慢30%。Guido认为Py3.0有极大的优化空间，在字符串和整形操作上可 <br style=\\\"margin:0px;padding:0px;\\\"/>以取得很好的优化结果。 <br style=\\\"margin:0px;padding:0px;\\\"/>Py3.1性能比Py2.5慢15%，还有很大的提升空间。 <br style=\\\"margin:0px;padding:0px;\\\"/><strong style=\\\"margin:0px;padding:0px;\\\">2.编码 <br style=\\\"margin:0px;padding:0px;\\\"/></strong>Py3.X源码文件默认使用utf-8编码，这就使得以下代码是合法的： <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; 中国 = 'china' <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt;print(中国) <br style=\\\"margin:0px;padding:0px;\\\"/>    china <br style=\\\"margin:0px;padding:0px;\\\"/><strong style=\\\"margin:0px;padding:0px;\\\">3. 语法</strong> <br style=\\\"margin:0px;padding:0px;\\\"/>1）去除了&lt;&gt;，全部改用!= <br style=\\\"margin:0px;padding:0px;\\\"/>2）去除``，全部改用repr() <br style=\\\"margin:0px;padding:0px;\\\"/>3）关键词加入as 和with，还有True,False,None <br style=\\\"margin:0px;padding:0px;\\\"/>4）整型除法返回浮点数，要得到整型结果，请使用// <br style=\\\"margin:0px;padding:0px;\\\"/>5）加入nonlocal语句。使用noclocal x可以直接指派外围（非全局）变量 <br style=\\\"margin:0px;padding:0px;\\\"/>6）去除print语句，加入print()函数实现相同的功能。同样的还有 exec语句，已经改为exec()函数 <br style=\\\"margin:0px;padding:0px;\\\"/>   例如： <br style=\\\"margin:0px;padding:0px;\\\"/>     2.X: print &quot;The answer is&quot;, 2*2 <br style=\\\"margin:0px;padding:0px;\\\"/>     3.X: print(&quot;The answer is&quot;, 2*2) <br style=\\\"margin:0px;padding:0px;\\\"/>     2.X: print x,                              # 使用逗号结尾禁止换行 <br style=\\\"margin:0px;padding:0px;\\\"/>     3.X: print(x, end=&quot; &quot;)                     # 使用空格代替换行 <br style=\\\"margin:0px;padding:0px;\\\"/>     2.X: print                                 # 输出新行 <br style=\\\"margin:0px;padding:0px;\\\"/>     3.X: print()                               # 输出新行 <br style=\\\"margin:0px;padding:0px;\\\"/>     2.X: print &gt;&gt;sys.stderr, &quot;fatal error&quot; <br style=\\\"margin:0px;padding:0px;\\\"/>     3.X: print(&quot;fatal error&quot;, file=sys.stderr) <br style=\\\"margin:0px;padding:0px;\\\"/>     2.X: print (x, y)                          # 输出repr((x, y)) <br style=\\\"margin:0px;padding:0px;\\\"/>     3.X: print((x, y))                         # 不同于print(x, y)! <br style=\\\"margin:0px;padding:0px;\\\"/>7）改变了顺序操作符的行为，例如x&lt;y，当x和y类型不匹配时抛出TypeError而不是返回随即的 bool值  <br style=\\\"margin:0px;padding:0px;\\\"/>8）输入函数改变了，删除了raw_input，用input代替： <br style=\\\"margin:0px;padding:0px;\\\"/>   2.X:guess = int(raw_input('Enter an integer : ')) # 读取键盘输入的方法 <br style=\\\"margin:0px;padding:0px;\\\"/>   3.X:guess = int(input('Enter an integer : '))</p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\">9）去除元组参数解包。不能def(a, (b, c)):pass这样定义函数了 <br style=\\\"margin:0px;padding:0px;\\\"/>10）新式的8进制字变量，相应地修改了oct()函数。 <br style=\\\"margin:0px;padding:0px;\\\"/>   2.X的方式如下： <br style=\\\"margin:0px;padding:0px;\\\"/>     &gt;&gt;&gt; 0666 <br style=\\\"margin:0px;padding:0px;\\\"/>     438 <br style=\\\"margin:0px;padding:0px;\\\"/>     &gt;&gt;&gt; oct(438) <br style=\\\"margin:0px;padding:0px;\\\"/>     '0666' <br style=\\\"margin:0px;padding:0px;\\\"/>   3.X这样： <br style=\\\"margin:0px;padding:0px;\\\"/>     &gt;&gt;&gt; 0666 <br style=\\\"margin:0px;padding:0px;\\\"/>     SyntaxError: invalid token (&lt;pyshell#63&gt;, line 1) <br style=\\\"margin:0px;padding:0px;\\\"/>     &gt;&gt;&gt; 0o666 <br style=\\\"margin:0px;padding:0px;\\\"/>     438 <br style=\\\"margin:0px;padding:0px;\\\"/>     &gt;&gt;&gt; oct(438) <br style=\\\"margin:0px;padding:0px;\\\"/>     '0o666' <br style=\\\"margin:0px;padding:0px;\\\"/>11）增加了 2进制字面量和bin()函数 <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; bin(438) <br style=\\\"margin:0px;padding:0px;\\\"/>    '0b110110110' <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; _438 = '0b110110110' <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; _438 <br style=\\\"margin:0px;padding:0px;\\\"/>    '0b110110110' <br style=\\\"margin:0px;padding:0px;\\\"/>12）扩展的可迭代解包。在Py3.X 里，a, b, *rest = seq和 *rest, a = seq都是合法的，只要求两点：rest是list <br style=\\\"margin:0px;padding:0px;\\\"/>对象和seq是可迭代的。 <br style=\\\"margin:0px;padding:0px;\\\"/>13）新的super()，可以不再给super()传参数， <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; class C(object): <br style=\\\"margin:0px;padding:0px;\\\"/>          def __init__(self, a): <br style=\\\"margin:0px;padding:0px;\\\"/>             print('C', a) <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; class D(C): <br style=\\\"margin:0px;padding:0px;\\\"/>          def __init(self, a): <br style=\\\"margin:0px;padding:0px;\\\"/>             super().__init__(a) # 无参数调用super() <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; D(8) <br style=\\\"margin:0px;padding:0px;\\\"/>    C 8 <br style=\\\"margin:0px;padding:0px;\\\"/>    &lt;__main__.D object at 0x00D7ED90&gt; <br style=\\\"margin:0px;padding:0px;\\\"/>14）新的metaclass语法： <br style=\\\"margin:0px;padding:0px;\\\"/>    class Foo(*bases, **kwds): <br style=\\\"margin:0px;padding:0px;\\\"/>      pass <br style=\\\"margin:0px;padding:0px;\\\"/>15）支持class decorator。用法与函数decorator一样： <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; def foo(cls_a): <br style=\\\"margin:0px;padding:0px;\\\"/>          def print_func(self): <br style=\\\"margin:0px;padding:0px;\\\"/>             print('Hello, world!') <br style=\\\"margin:0px;padding:0px;\\\"/>          cls_a.print = print_func <br style=\\\"margin:0px;padding:0px;\\\"/>          return cls_a <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; @foo <br style=\\\"margin:0px;padding:0px;\\\"/>    class C(object): <br style=\\\"margin:0px;padding:0px;\\\"/>      pass <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; C().print() <br style=\\\"margin:0px;padding:0px;\\\"/>    Hello, world! <br style=\\\"margin:0px;padding:0px;\\\"/>class decorator可以用来玩玩狸猫换太子的大把戏。更多请参阅PEP 3129 <br style=\\\"margin:0px;padding:0px;\\\"/><strong style=\\\"margin:0px;padding:0px;\\\">4. 字符串和字节串</strong> <br style=\\\"margin:0px;padding:0px;\\\"/>1）现在字符串只有str一种类型，但它跟2.x版本的unicode几乎一样。</p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\">2）关于字节串，请参阅“数据类型”的第2条目 <br style=\\\"margin:0px;padding:0px;\\\"/><strong style=\\\"margin:0px;padding:0px;\\\">5.数据类型</strong> <br style=\\\"margin:0px;padding:0px;\\\"/>1）Py3.X去除了long类型，现在只有一种整型——int，但它的行为就像2.X版本的long <br style=\\\"margin:0px;padding:0px;\\\"/>2）新增了bytes类型，对应于2.X版本的八位串，定义一个bytes字面量的方法如下： <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; b = b'china' <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; type(b) <br style=\\\"margin:0px;padding:0px;\\\"/>    &lt;type 'bytes'&gt; <br style=\\\"margin:0px;padding:0px;\\\"/>str对象和bytes对象可以使用.encode() (str -&gt; bytes) or .decode() (bytes -&gt; str)方法相互转化。 <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; s = b.decode() <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; s <br style=\\\"margin:0px;padding:0px;\\\"/>    'china' <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; b1 = s.encode() <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; b1 <br style=\\\"margin:0px;padding:0px;\\\"/>    b'china' <br style=\\\"margin:0px;padding:0px;\\\"/>3）dict的.keys()、.items 和.values()方法返回迭代器，而之前的iterkeys()等函数都被废弃。同时去掉的还有 <br style=\\\"margin:0px;padding:0px;\\\"/>dict.has_key()，用 in替代它吧 <br style=\\\"margin:0px;padding:0px;\\\"/><strong style=\\\"margin:0px;padding:0px;\\\">6.面向对象 <br style=\\\"margin:0px;padding:0px;\\\"/></strong>1）引入抽象基类（Abstraact Base Classes，ABCs）。 <br style=\\\"margin:0px;padding:0px;\\\"/>2）容器类和迭代器类被ABCs化，所以cellections模块里的类型比Py2.5多了很多。 <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; import collections <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; print('\\\\\n'.join(dir(collections))) <br style=\\\"margin:0px;padding:0px;\\\"/>    Callable <br style=\\\"margin:0px;padding:0px;\\\"/>    Container <br style=\\\"margin:0px;padding:0px;\\\"/>    Hashable <br style=\\\"margin:0px;padding:0px;\\\"/>    ItemsView <br style=\\\"margin:0px;padding:0px;\\\"/>    Iterable <br style=\\\"margin:0px;padding:0px;\\\"/>    Iterator <br style=\\\"margin:0px;padding:0px;\\\"/>    KeysView <br style=\\\"margin:0px;padding:0px;\\\"/>    Mapping <br style=\\\"margin:0px;padding:0px;\\\"/>    MappingView <br style=\\\"margin:0px;padding:0px;\\\"/>    MutableMapping <br style=\\\"margin:0px;padding:0px;\\\"/>    MutableSequence <br style=\\\"margin:0px;padding:0px;\\\"/>    MutableSet <br style=\\\"margin:0px;padding:0px;\\\"/>    NamedTuple <br style=\\\"margin:0px;padding:0px;\\\"/>    Sequence <br style=\\\"margin:0px;padding:0px;\\\"/>    Set <br style=\\\"margin:0px;padding:0px;\\\"/>    Sized <br style=\\\"margin:0px;padding:0px;\\\"/>    ValuesView <br style=\\\"margin:0px;padding:0px;\\\"/>    __all__ <br style=\\\"margin:0px;padding:0px;\\\"/>    __builtins__ <br style=\\\"margin:0px;padding:0px;\\\"/>    __doc__ <br style=\\\"margin:0px;padding:0px;\\\"/>    __file__ <br style=\\\"margin:0px;padding:0px;\\\"/>    __name__ <br style=\\\"margin:0px;padding:0px;\\\"/>    _abcoll <br style=\\\"margin:0px;padding:0px;\\\"/>    _itemgetter <br style=\\\"margin:0px;padding:0px;\\\"/>    _sys <br style=\\\"margin:0px;padding:0px;\\\"/>    defaultdict <br style=\\\"margin:0px;padding:0px;\\\"/>    deque <br style=\\\"margin:0px;padding:0px;\\\"/>另外，数值类型也被ABCs化。关于这两点，请参阅 PEP 3119和PEP 3141。 <br style=\\\"margin:0px;padding:0px;\\\"/>3）迭代器的next()方法改名为__next__()，并增加内置函数next()，用以调用迭代器的__next__()方法 <br style=\\\"margin:0px;padding:0px;\\\"/>4）增加了@abstractmethod和 @abstractproperty两个 decorator，编写抽象方法（属性）更加方便。 <br style=\\\"margin:0px;padding:0px;\\\"/><strong style=\\\"margin:0px;padding:0px;\\\">7.异常</strong> <br style=\\\"margin:0px;padding:0px;\\\"/>1）所以异常都从 BaseException继承，并删除了StardardError <br style=\\\"margin:0px;padding:0px;\\\"/>2）去除了异常类的序列行为和.message属性 <br style=\\\"margin:0px;padding:0px;\\\"/>3）用 raise Exception(args)代替 raise Exception, args语法 <br style=\\\"margin:0px;padding:0px;\\\"/>4）捕获异常的语法改变，引入了as关键字来标识异常实例，在Py2.5中： <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; try: <br style=\\\"margin:0px;padding:0px;\\\"/>    ...    raise NotImplementedError('Error') <br style=\\\"margin:0px;padding:0px;\\\"/>    ... except NotImplementedError, error:</p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\">    ...    print error.message <br style=\\\"margin:0px;padding:0px;\\\"/>    ... <br style=\\\"margin:0px;padding:0px;\\\"/>    Error <br style=\\\"margin:0px;padding:0px;\\\"/>在Py3.0中： <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; try: <br style=\\\"margin:0px;padding:0px;\\\"/>          raise NotImplementedError('Error') <br style=\\\"margin:0px;padding:0px;\\\"/>        except NotImplementedError as error: #注意这个 as <br style=\\\"margin:0px;padding:0px;\\\"/>          print(str(error)) <br style=\\\"margin:0px;padding:0px;\\\"/>    Error <br style=\\\"margin:0px;padding:0px;\\\"/>5）异常链，因为__context__在3.0a1版本中没有实现 <br style=\\\"margin:0px;padding:0px;\\\"/><strong style=\\\"margin:0px;padding:0px;\\\">8.模块变动</strong> <br style=\\\"margin:0px;padding:0px;\\\"/>1）移除了cPickle模块，可以使用pickle模块代替。最终我们将会有一个透明高效的模块。 <br style=\\\"margin:0px;padding:0px;\\\"/>2）移除了imageop模块 <br style=\\\"margin:0px;padding:0px;\\\"/>3）移除了 audiodev, Bastion, bsddb185, exceptions, linuxaudiodev, md5, MimeWriter, mimify, popen2,  <br style=\\\"margin:0px;padding:0px;\\\"/>rexec, sets, sha, stringold, strop, sunaudiodev, timing和xmllib模块 <br style=\\\"margin:0px;padding:0px;\\\"/>4）移除了bsddb模块(单独发布，可以从<a href=\\\"http://www.jcea.es/programacion/pybsddb.htm\\\" style=\\\"margin:0px;padding:1px 3px;color:green;text-decoration:none;\\\">http://www.jcea.es/programacion/pybsddb.htm</a>获取) <br style=\\\"margin:0px;padding:0px;\\\"/>5）移除了new模块 <br style=\\\"margin:0px;padding:0px;\\\"/>6）os.tmpnam()和os.tmpfile()函数被移动到tmpfile模块下 <br style=\\\"margin:0px;padding:0px;\\\"/>7）tokenize模块现在使用bytes工作。主要的入口点不再是generate_tokens，而是 tokenize.tokenize() <br style=\\\"margin:0px;padding:0px;\\\"/><strong style=\\\"margin:0px;padding:0px;\\\">9.其它 <br style=\\\"margin:0px;padding:0px;\\\"/></strong>1）xrange() 改名为range()，要想使用range()获得一个list，必须显式调用： <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; list(range(10)) <br style=\\\"margin:0px;padding:0px;\\\"/>    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] <br style=\\\"margin:0px;padding:0px;\\\"/>2）bytes对象不能hash，也不支持 b.lower()、b.strip()和b.split()方法，但对于后两者可以使用 b.strip(b’  <br style=\\\"margin:0px;padding:0px;\\\"/>\\\\\n\\\\t\\\\\r \\\\f’)和b.split(b’ ‘)来达到相同目的 <br style=\\\"margin:0px;padding:0px;\\\"/>3）zip()、map()和filter()都返回迭代器。而apply()、 callable()、coerce()、 execfile()、reduce()和reload <br style=\\\"margin:0px;padding:0px;\\\"/>()函数都被去除了</p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\">现在可以使用hasattr()来替换 callable(). hasattr()的语法如：hasattr(string, '__name__')</p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\">4）string.letters和相关的.lowercase和.uppercase被去除，请改用string.ascii_letters 等 <br style=\\\"margin:0px;padding:0px;\\\"/>5）如果x &lt; y的不能比较，抛出TypeError异常。2.x版本是返回伪随机布尔值的 <br style=\\\"margin:0px;padding:0px;\\\"/>6）__getslice__系列成员被废弃。a[i:j]根据上下文转换为a.__getitem__(slice(I, j))或 __setitem__和 <br style=\\\"margin:0px;padding:0px;\\\"/>__delitem__调用 <br style=\\\"margin:0px;padding:0px;\\\"/>7）file类被废弃，在Py2.5中： <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; file <br style=\\\"margin:0px;padding:0px;\\\"/>    &lt;type 'file'&gt; <br style=\\\"margin:0px;padding:0px;\\\"/>在Py3.X中： <br style=\\\"margin:0px;padding:0px;\\\"/>    &gt;&gt;&gt; file <br style=\\\"margin:0px;padding:0px;\\\"/>    Traceback (most recent call last): <br style=\\\"margin:0px;padding:0px;\\\"/>    File &quot;&lt;pyshell#120&gt;&quot;, line 1, in &lt;module&gt; <br style=\\\"margin:0px;padding:0px;\\\"/>       file <br style=\\\"margin:0px;padding:0px;\\\"/>    NameError: name 'file' is not defined</p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"> </p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\">原文是指: <a href=\\\"http://www.cnblogs.com/codingmylife/archive/2010/06/06/1752807.html\\\" style=\\\"margin:0px;padding:1px 3px;color:green;text-decoration:none;\\\">http://www.cnblogs.com/codingmylife/archive/2010/06/06/1752807.html</a></p></div><div style=\\\"margin:0px;padding:10px;display:block;border:1px solid rgb(232, 231, 208);box-shadow:rgb(170, 170, 170) 0px 0px 15px;margin-bottom:10px;color:gray;background-color:rgb(248, 248, 238);\\\">code奸我千百遍，我待code如初见</div>\\\n<div style=\\\"margin:0px;padding:0px;clear:both;\\\"></div>\\\n<div style=\\\"margin:0px;padding:0px;margin-top:20px;\\\">\\\n<div style=\\\"margin:0px;padding:0px;margin-bottom:5px;\\\">分类: <a href=\\\"http://www.cnblogs.com/likebeta/category/342240.html\\\" style=\\\"margin:0px;padding:1px 3px;color:green;text-decoration:none;\\\">python</a></div>\\\n<div style=\\\"margin:0px;padding:0px;margin-top:0px;font-size:9pt;color:gray;text-align:right;\\\">标签: <a href=\\\"http://www.cnblogs.com/likebeta/tag/python/\\\" style=\\\"margin:0px;padding:1px 3px;color:rgb(255, 255, 255);text-decoration:none;background-color:green;\\\">python</a></div>\\\n<div style=\\\"margin:0px;padding:0px;\\\"><div style=\\\"margin:0px;padding:10px 5px;margin-bottom:10px;margin-top:10px;border:1px dashed silver;font-size:9pt;width:430px;\\\">\\\n绿色通道：\\\n<a href=\\\"#\\\" style=\\\"margin:0px;padding:3px 8px;color:rgb(255, 255, 255);text-decoration:none;display:inline-block;font-weight:bold;cursor:pointer;margin-right:10px;border-radius:10px;-webkit-box-shadow:rgba(0, 0, 0, 0.498039) 0px 1px 3px;text-shadow:rgba(0, 0, 0, 0.247059) 0px -1px 1px;font-size:9pt;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHhJREFUeNo8zjsOxCAMBFB/KEAUFFR0Cbng3nQPw68ArZdAlOZppPFIBhH5EAB8b+Tlt9MYQ6i1BuqFaq1CKSVcxZ2Acs6406KUgpt5/LCKuVgz5BDCSb13ZO99ZOdcZGvt4mJjzMVKqcha68iIePB86GAiOv8CDADlIUQBs7MD3wAAAABJRU5ErkJggg%3D%3D) repeat-x;border:none;background-color:rgb(45, 174, 191);\\\">好文要顶</a>\\\n<a href=\\\"#\\\" style=\\\"margin:0px;padding:3px 8px;color:rgb(255, 255, 255);text-decoration:none;display:inline-block;font-weight:bold;cursor:pointer;margin-right:10px;border-radius:10px;-webkit-box-shadow:rgba(0, 0, 0, 0.498039) 0px 1px 3px;text-shadow:rgba(0, 0, 0, 0.247059) 0px -1px 1px;font-size:9pt;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHhJREFUeNo8zjsOxCAMBFB/KEAUFFR0Cbng3nQPw68ArZdAlOZppPFIBhH5EAB8b+Tlt9MYQ6i1BuqFaq1CKSVcxZ2Acs6406KUgpt5/LCKuVgz5BDCSb13ZO99ZOdcZGvt4mJjzMVKqcha68iIePB86GAiOv8CDADlIUQBs7MD3wAAAABJRU5ErkJggg%3D%3D) repeat-x;border:none;background-color:rgb(227, 49, 0);\\\">关注我</a>\\\n<a href=\\\"#\\\" style=\\\"margin:0px;padding:3px 8px;color:rgb(255, 255, 255);text-decoration:none;display:inline-block;font-weight:bold;cursor:pointer;margin-right:10px;border-radius:10px;-webkit-box-shadow:rgba(0, 0, 0, 0.498039) 0px 1px 3px;text-shadow:rgba(0, 0, 0, 0.247059) 0px -1px 1px;font-size:9pt;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHhJREFUeNo8zjsOxCAMBFB/KEAUFFR0Cbng3nQPw68ArZdAlOZppPFIBhH5EAB8b+Tlt9MYQ6i1BuqFaq1CKSVcxZ2Acs6406KUgpt5/LCKuVgz5BDCSb13ZO99ZOdcZGvt4mJjzMVKqcha68iIePB86GAiOv8CDADlIUQBs7MD3wAAAABJRU5ErkJggg%3D%3D) repeat-x;border:none;background-color:rgb(255, 181, 21);\\\">收藏该文</a><a href=\\\"http://space.cnblogs.com/msg/send/likebeta\\\" style=\\\"margin:0px;padding:3px 8px;color:rgb(255, 255, 255);text-decoration:none;display:inline-block;font-weight:bold;cursor:pointer;margin-right:10px;border-radius:10px;-webkit-box-shadow:rgba(0, 0, 0, 0.498039) 0px 1px 3px;text-shadow:rgba(0, 0, 0, 0.247059) 0px -1px 1px;font-size:9pt;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHhJREFUeNo8zjsOxCAMBFB/KEAUFFR0Cbng3nQPw68ArZdAlOZppPFIBhH5EAB8b+Tlt9MYQ6i1BuqFaq1CKSVcxZ2Acs6406KUgpt5/LCKuVgz5BDCSb13ZO99ZOdcZGvt4mJjzMVKqcha68iIePB86GAiOv8CDADlIUQBs7MD3wAAAABJRU5ErkJggg%3D%3D) repeat-x;border:none;background-color:rgb(238, 238, 238);\\\" target=\\\"_blank\\\">与我联系</a>\\\n<a href=\\\"#\\\" style=\\\"margin:0px;padding:3px 2px;color:rgb(255, 255, 255);text-decoration:none;display:inline-block;font-weight:bold;cursor:pointer;margin-right:10px;border-radius:10px;-webkit-box-shadow:none;text-shadow:none;font-size:9pt;background:none;border:none;\\\" title=\\\"分享至新浪微博\\\"><img src=\\\":/83e672adab354e2f9d8995a6c7a16101\\\" type=\\\"image/png\\\" data-filename=\\\"icon_weibo_24.png\\\" height=\\\"24\\\" style=\\\"margin:0px;padding:0px;border:none;vertical-align:middle;margin-left:5px;box-shadow:none;\\\" width=\\\"24\\\"/></a>\\\n</div>\\\n<div style=\\\"margin:0px;padding:0px;float:left;width:280px;margin-top:0px;margin-bottom:10px;color:rgb(0, 0, 0);margin-left:0px;font-size:12px;\\\">\\\n<div style=\\\"margin:0px;padding:0px;float:left;line-height:18px;\\\">\\\n<a href=\\\"http://home.cnblogs.com/u/likebeta/\\\" style=\\\"margin:0px;padding:1px 3px;color:green;text-decoration:none;\\\" target=\\\"_blank\\\"><img src=\\\":/8595c3bebd124b36b14212d310fc7a0d\\\" type=\\\"image/jpeg\\\" data-filename=\\\"20131208181538.png.jpg\\\" height=\\\"48\\\" style=\\\"margin:0px;padding:0px;border:0px;vertical-align:top;float:left;margin-right:5px;padding-top:5px;padding-left:2px;\\\" width=\\\"48\\\"/></a>\\\n<div style=\\\"margin:0px;padding:0px;float:left;line-height:18px;\\\">\\\n<a href=\\\"http://home.cnblogs.com/u/likebeta/\\\" style=\\\"margin:0px;padding:1px 3px;color:green;text-decoration:none;\\\">likebeta</a><br style=\\\"margin:0px;padding:0px;\\\"/>\\\n<a href=\\\"http://home.cnblogs.com/u/likebeta/followees\\\" style=\\\"margin:0px;padding:1px 3px;color:green;text-decoration:none;\\\">关注 - 24</a><br style=\\\"margin:0px;padding:0px;\\\"/>\\\n<a href=\\\"http://home.cnblogs.com/u/likebeta/followers\\\" style=\\\"margin:0px;padding:1px 3px;color:green;text-decoration:none;\\\">粉丝 - 30</a>\\\n</div>\\\n</div>\\\n<div style=\\\"margin:0px;padding:0px;clear:both;\\\"></div>\\\n<div style=\\\"margin:0px;padding:0px;\\\"></div>\\\n<div style=\\\"margin:0px;padding:0px;\\\">\\\n    <a href=\\\"#\\\" style=\\\"margin:0px;padding:1px 3px;color:green;text-decoration:none;\\\">+加关注</a>\\\n</div>\\\n</div>\\\n<div style=\\\"margin:0px;padding:0px;float:right;margin-bottom:10px;margin-right:30px;font-size:12px;width:125px;text-align:center;margin-top:10px;\\\">\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\\n    <div style=\\\"margin:0px;padding:0px;float:left;width:46px;height:52px;text-align:center;cursor:pointer;margin-top:2px;padding-top:5px;background:url(http://static.cnblogs.com/images/upup.gif) no-repeat;\\\">\\\n        <span style=\\\"margin:0px;padding:0px;font-size:14px;color:rgb(7, 93, 179);font-family:Verdana;line-height:1.5em;\\\">0</span>\\\n    </div>\\\n\\t<div style=\\\"margin:0px;padding:0px;float:right;margin-left:20px;width:46px;height:52px;text-align:center;cursor:pointer;margin-top:2px;padding-top:5px;background:url(http://static.cnblogs.com/images/downdown.gif) no-repeat;\\\"> \\\n\\t\\t<span style=\\\"margin:0px;padding:0px;font-size:14px;color:rgb(7, 93, 179);font-family:Verdana;line-height:1.5em;\\\">0</span>\\\n\\t</div>\\\n\\t<div style=\\\"margin:0px;padding:0px;clear:both;\\\"></div>\\t\\\n\\t<div style=\\\"margin:0px;padding:0px;margin-top:5px;margin-left:0px;font-size:12px;color:gray;\\\">\\\n    (请您对文章做出评价)\\\n    </div>\\t\\\n</div>\\\n</div>\\\n<div style=\\\"margin:0px;padding:0px;clear:both;\\\"></div>\\\n<div style=\\\"margin:0px;padding:0px;line-height:1.8;font-size:12px;\\\"><a href=\\\"http://www.cnblogs.com/likebeta/archive/2011/12/13/2285664.html\\\" style=\\\"margin:0px;padding:1px 3px;color:green;text-decoration:none;\\\">« </a> 上一篇：<a href=\\\"http://www.cnblogs.com/likebeta/archive/2011/12/13/2285664.html\\\" style=\\\"margin:0px;padding:1px 3px;color:green;text-decoration:none;\\\" title=\\\"发布于2011-12-13 10:16\\\">Ubuntu:让桌面显示回收站</a><br style=\\\"margin:0px;padding:0px;\\\"/><a href=\\\"http://www.cnblogs.com/likebeta/archive/2011/12/18/2291874.html\\\" style=\\\"margin:0px;padding:1px 3px;color:green;text-decoration:none;\\\">» </a> 下一篇：<a href=\\\"http://www.cnblogs.com/likebeta/archive/2011/12/18/2291874.html\\\" style=\\\"margin:0px;padding:1px 3px;color:green;text-decoration:none;\\\" title=\\\"发布于2011-12-18 17:32\\\">utf-8编码php页面调用scandir产生乱码</a><br style=\\\"margin:0px;padding:0px;\\\"/></div>\\\n</div>\\\n\\\n\\\n\\t\\t</div>\\\n\\t\\t<div style=\\\"margin:0px;padding:0px;color:gray;text-align:right;padding-left:15px;padding-right:15px;margin-bottom:5px;\\\">posted @ <span style=\\\"margin:0px;padding:0px;\\\">2011-12-13 13:28</span> <a href=\\\"http://www.cnblogs.com/likebeta/\\\" style=\\\"margin:0px;padding:0px;color:gray;text-decoration:none;\\\">likebeta</a> 阅读(<span style=\\\"margin:0px;padding:0px;\\\">444</span>) 评论(<span style=\\\"margin:0px;padding:0px;\\\">0</span>)  <a href=\\\"http://i.cnblogs.com/EditPosts.aspx?postid=2285964\\\" rel=\\\"nofollow\\\" style=\\\"margin:0px;padding:0px;color:gray;text-decoration:none;\\\">编辑</a> <a href=\\\"http://www.cnblogs.com/likebeta/archive/2011/12/13/2285964.html#\\\" style=\\\"margin:0px;padding:0px;color:gray;text-decoration:none;\\\">收藏</a></div>\\\n\\t</div></div></div></div></div></div></div></div></div><br/></span>\\\n</div></body></html>\\u0000\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":24022}]"
metadata_diff: {"new":{"id":"fba7ebbed710424689420d9ffe79faaa","parent_id":"f67288c3a0be4374b5d532b5dcc3aabc","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1764348823532,"markup_language":2,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":0},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2025-11-28T21:03:59.717Z
created_time: 2025-11-28T21:03:59.717Z
type_: 13