码迷,mamicode.com
首页 > 其他好文 > 详细

six.moves的用法

时间:2017-12-12 15:19:38      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:body   util   rar   兼容   from   ons   load   parse   div   

six是用来兼容python 2 和 3的,我猜名字就是用的2和3的最小公倍数。

six.moves 是用来处理那些在2 和 3里面函数的位置有变化的,直接用six.moves就可以屏蔽掉这些变化

 

Python 3 reorganized the standard library and moved several functions to different modules. Six provides a consistent interface to them through the fake six.moves module. For example, to load the module for parsing HTML on Python 2 or 3, write:

from six.moves import html_parser

Similarly, to get the function to reload modules, which was moved from the builtin module to the imp module, use:

from six.moves import reload_module

 

six.moves的用法

标签:body   util   rar   兼容   from   ons   load   parse   div   

原文地址:http://www.cnblogs.com/charlesblc/p/8027289.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!