html tool

2013年5月5日星期日

Dive into Python 的我的翻译 IXXXX------8.5 X


[原文]P111
Using the locals and globals functions, you can get the value of arbitrary variables dynamically, providing the variable name as a string. This mirrors the functionality of the getattr function, which allows you to access arbitrary functions dynamically by providing the function name as a string.
[?] 使用 locals 和 globals 函数你可以增加任何变量为动态加载变量。这个getattr 函数如何使用才能加载呢?有例子吗?这句话是这个意思吗?晕

[pope译]
使用这个 locals 和globals函数,你可以获得任何{arbitrary}变量的动态值,其提供{providing}的变量名称为字符串格式.使用getattr函数映射{mirrors}到对应的功能函数,它允许你对任何{arbitrary}函数,通过使用函数名称的字符串来完成动态访问。
[net 译 来源:http://woodpecker.org.cn/diveintopython/html_processing/locals_and_globals.html]
使用 locals  globals 函数,通过提供变量的字符串名字您可以动态地得到任何变量的值。这种方法提供了这样的功能:getattr 函数允许您通过提供函数的字符串名来动态地访问任意的函数。


[原文]P111
There is one other important difference between the locals and globals functions, which you should learn now before it bites you. It will bite you anyway, but at least then you'll remember learning it.
[popexizhi] bite you嘻嘻这个说法好形象啊:)
[pope译]
在这个locals和globals函数之间有一个重要的区别,你最好在它开始咬你{bites you :)}之前就搞懂它。它可能在任何地方咬你,直到你最后记着这个区别。
[net 译 来源:http://woodpecker.org.cn/diveintopython/html_processing/locals_and_globals.html]
在 locals 与 globals 之间有另外一个重要的区别,您应该在它困扰您之前就了解它。它无论如何都会困扰您的,但至少您还会记得曾经学习过它。
[popexizhi]
bites you
[pope译]咬你
[net 译]困扰您
[popexizhi]go了一下韦氏字典(http://www.merriam-webster.com/dictionary/bite)应该主要就是尖锐物体引起不适应的引起的。net翻译的不错,困扰,嘻嘻:),pope还是直译为咬吧!很形象:)

没有评论:

发表评论