File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1129,6 +1129,10 @@ msgid ""
11291129" ``\" {:04d}\" .format(144)`` yields ``'0144'`` and "
11301130"``\" {:.3f}\" .format(1.0/3.0)`` yields ``'0.333'``."
11311131msgstr ""
1132+ "例如要将数字 144 转换为字符串 '144',可使用内置类型构造器 :func:`str`。 如果想要表示为十六进制或八进制数,可使用内置函数 "
1133+ ":func:`hex` 或 :func:`oct`。 想要更好地格式化,请参阅 :ref:`f-strings` 和 "
1134+ ":ref:`formatstrings` 等小节,例如 ``\" {:04d}\" .format(144)`` 生成 ``'0144'`` 而 "
1135+ "``\" {:.3f}\" .format(1.0/3.0)`` 生成 ``'0.333'``。"
11321136
11331137#: ../../faq/programming.rst:890
11341138msgid "How do I modify a string in place?"
@@ -1142,14 +1146,16 @@ msgid ""
11421146"unicode data, try using an :class:`io.StringIO` object or the :mod:`array` "
11431147"module::"
11441148msgstr ""
1149+ "无法修改,因为字符串是不可变对象。 在大多数情况下,你应该使用你想要的各种部分来构造一个新字符串。 但是,如果你想要一个可以原地修改 Unicode "
1150+ "数据的对象,可尝试使用 :class:`io.StringIO` 对象或 :mod:`array` 模块::"
11451151
11461152#: ../../faq/programming.rst:922
11471153msgid "How do I use strings to call functions/methods?"
11481154msgstr "如何使用字符串调用函数/方法?"
11491155
11501156#: ../../faq/programming.rst:924
11511157msgid "There are various techniques."
1152- msgstr "有各种技术 。"
1158+ msgstr "有多种技巧可供选择 。"
11531159
11541160#: ../../faq/programming.rst:926
11551161msgid ""
Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ msgstr ""
168168
169169#: ../../reference/import.rst:93
170170msgid "Regular packages"
171- msgstr "正规包 "
171+ msgstr "常规包 "
172172
173173#: ../../reference/import.rst:98
174174msgid ""
@@ -182,9 +182,9 @@ msgid ""
182182"contain the same Python code that any other module can contain, and Python "
183183"will add some additional attributes to the module when it is imported."
184184msgstr ""
185- "Python 定义了两种类型的包,:term:`正规包 <regular package>` 和 :term:`命名空间包 <namespace "
186- "package>`。 正规包是传统的包类型 ,它们在 Python 3.2 及之前就已存在。 正规包通常以一个包含 ``__init__.py`` "
187- "文件的目录形式实现。 当一个正规包被导入时 ,这个 ``__init__.py`` "
185+ "Python 定义了两种类型的包,:term:`常规包 <regular package>` 和 :term:`命名空间包 <namespace "
186+ "package>`。 常规包是传统的包类型 ,它们在 Python 3.2 及之前就已存在。 常规包通常以一个包含 ``__init__.py`` "
187+ "文件的目录形式实现。 当一个常规包被导入时 ,这个 ``__init__.py`` "
188188"文件会隐式地被执行,它所定义的对象会被绑定到该包命名空间中的名称。``__init__.py`` 文件可以包含与任何其他模块中所包含的 Python "
189189"代码相似的代码,Python 将在模块被导入时为其添加额外的属性。"
190190
You can’t perform that action at this time.
0 commit comments