# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: # python-doc bot, 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2025-01-03 16:35+0000\n" "PO-Revision-Date: 2025-09-22 17:56+0000\n" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../tutorial/appetite.rst:5 msgid "Whetting Your Appetite" msgstr "课前甜点" #: ../../tutorial/appetite.rst:7 msgid "" "If you do much work on computers, eventually you find that there's some task" " you'd like to automate. For example, you may wish to perform a search-and-" "replace over a large number of text files, or rename and rearrange a bunch " "of photo files in a complicated way. Perhaps you'd like to write a small " "custom database, or a specialized GUI application, or a simple game." msgstr "" "如果您的工作主要是用电脑完成的,总有一天您会想能不能自动执行一些任务。比如,对大量文本文件执行查找、替换操作;利用复杂的规则重命名、重排序一堆照片文件;也可能您想编写一个小型数据库、或开发专用的图形界面应用,甚至是开发一个简单的游戏。" #: ../../tutorial/appetite.rst:13 msgid "" "If you're a professional software developer, you may have to work with " "several C/C++/Java libraries but find the usual write/compile/test/re-" "compile cycle is too slow. Perhaps you're writing a test suite for such a " "library and find writing the testing code a tedious task. Or maybe you've " "written a program that could use an extension language, and you don't want " "to design and implement a whole new language for your application." msgstr "" "作为一名专业软件开发人员,您可能要处理 C/C++/Java " "库,但编码、编译、测试、再编译这些开发流程太慢了;也许您正在给这些库开发测试套件,但总觉得这项工作真是枯燥乏味。又或许,您开发了个使用扩展语言的软件,却不想为这个软件专门设计一种新语言。" #: ../../tutorial/appetite.rst:20 msgid "Python is just the language for you." msgstr "那么,Python 正好能满足您的需要。" #: ../../tutorial/appetite.rst:22 msgid "" "You could write a Unix shell script or Windows batch files for some of these" " tasks, but shell scripts are best at moving around files and changing text " "data, not well-suited for GUI applications or games. You could write a " "C/C++/Java program, but it can take a lot of development time to get even a " "first-draft program. Python is simpler to use, available on Windows, macOS," " and Unix operating systems, and will help you get the job done more " "quickly." msgstr "" "你可以针对这些任务编写 Unix shell 脚本或 Windows 批处理文件,但 shell 脚本擅长的是移动文件和改变文本数据,而不适合编写 " "GUI 应用或游戏。 你可以编写 C/C++/Java 程序,但即使只完成一个初始版程序也需要耗费很长的开发时间。 Python " "则更为简单易用,同时支持 Windows, macOS 和 Unix 操作系统,并能帮助你更快速地完成工作。" #: ../../tutorial/appetite.rst:29 msgid "" "Python is simple to use, but it is a real programming language, offering " "much more structure and support for large programs than shell scripts or " "batch files can offer. On the other hand, Python also offers much more " "error checking than C, and, being a *very-high-level language*, it has high-" "level data types built in, such as flexible arrays and dictionaries. " "Because of its more general data types Python is applicable to a much larger" " problem domain than Awk or even Perl, yet many things are at least as easy " "in Python as in those languages." msgstr "" "Python 虽然简单易用,但它可是真正的编程语言,提供了大量的数据结构,也支持开发大型程序,远超 shell 脚本或批处理文件;Python " "提供的错误检查比 C 还多;作为一种“非常高级的语言”,它内置了灵活的数组与字典等高级数据类型。正因为配备了更通用的数据类型,Python 比 " "Awk,甚至 Perl 能解决更多问题,而且,很多时候,Python 比这些语言更简单。" #: ../../tutorial/appetite.rst:37 msgid "" "Python allows you to split your program into modules that can be reused in " "other Python programs. It comes with a large collection of standard modules" " that you can use as the basis of your programs --- or as examples to start " "learning to program in Python. Some of these modules provide things like " "file I/O, system calls, sockets, and even interfaces to graphical user " "interface toolkits like Tk." msgstr "" "Python 支持把程序分割为模块,以便在其他 Python 程序中复用。它还内置了大量标准模块,作为开发程序的基础 —— 您还可以把这些模块当作学习 " "Python 编程的实例。这些模块包括 I/O、系统调用、套接字,甚至还包括 Tk 图形用户界面工作套件。" #: ../../tutorial/appetite.rst:44 msgid "" "Python is an interpreted language, which can save you considerable time " "during program development because no compilation and linking is necessary." " The interpreter can be used interactively, which makes it easy to " "experiment with features of the language, to write throw-away programs, or " "to test functions during bottom-up program development. It is also a handy " "desk calculator." msgstr "" "Python " "是一种解释型语言,不需要编译和链接,可以节省大量开发时间。它的解释器实现了交互式操作,轻而易举地就能试用各种语言功能,编写临时程序,或在自底向上的程序开发中测试功能。同时,它还是一个超好用的计算器。" #: ../../tutorial/appetite.rst:50 msgid "" "Python enables programs to be written compactly and readably. Programs " "written in Python are typically much shorter than equivalent C, C++, or " "Java programs, for several reasons:" msgstr "Python 程序简洁、易读,通常比实现同种功能的 C、C++、Java 代码短很多,原因如下:" #: ../../tutorial/appetite.rst:54 msgid "" "the high-level data types allow you to express complex operations in a " "single statement;" msgstr "高级数据类型允许在单一语句中表述复杂操作;" #: ../../tutorial/appetite.rst:57 msgid "" "statement grouping is done by indentation instead of beginning and ending " "brackets;" msgstr "使用缩进,而不是括号实现代码块分组;" #: ../../tutorial/appetite.rst:60 msgid "no variable or argument declarations are necessary." msgstr "无需预声明变量或参数。" #: ../../tutorial/appetite.rst:62 msgid "" "Python is *extensible*: if you know how to program in C it is easy to add a " "new built-in function or module to the interpreter, either to perform " "critical operations at maximum speed, or to link Python programs to " "libraries that may only be available in binary form (such as a vendor-" "specific graphics library). Once you are really hooked, you can link the " "Python interpreter into an application written in C and use it as an " "extension or command language for that application." msgstr "" "Python “可以扩展”:会开发 C 语言程序,就能快速上手为解释器增加新的内置函数或模块,不论是让核心程序以最高速度运行,还是把 Python " "程序链接到只提供预编译程序的库(比如,硬件图形库)。只要下点功夫,就能把 Python 解释器和用 C 开发的应用链接在一起,用它来扩展和控制该应用。" #: ../../tutorial/appetite.rst:70 msgid "" "By the way, the language is named after the BBC show \"Monty Python's Flying" " Circus\" and has nothing to do with reptiles. Making references to Monty " "Python skits in documentation is not only allowed, it is encouraged!" msgstr "" "顺便提一句,本语言的命名源自 BBC 的 “Monty Python 飞行马戏团”,与爬行动物无关(Python 原义为“蟒蛇”)。欢迎大家在文档中引用" " Monty Python 小品短篇集,多多益善!" #: ../../tutorial/appetite.rst:74 msgid "" "Now that you are all excited about Python, you'll want to examine it in some" " more detail. Since the best way to learn a language is to use it, the " "tutorial invites you to play with the Python interpreter as you read." msgstr "" "现在,您已经对 Python 跃跃欲试,想深入了解一些细节了吧。要知道,学习语言的最佳方式是上手实践,建议您边阅读本教程,边在 Python " "解释器中练习。" #: ../../tutorial/appetite.rst:78 msgid "" "In the next chapter, the mechanics of using the interpreter are explained. " "This is rather mundane information, but essential for trying out the " "examples shown later." msgstr "下一章介绍解释器的用法。这部分内容有些单调乏味,但对上手实践后面的例子来说却至关重要。" #: ../../tutorial/appetite.rst:82 msgid "" "The rest of the tutorial introduces various features of the Python language " "and system through examples, beginning with simple expressions, statements " "and data types, through functions and modules, and finally touching upon " "advanced concepts like exceptions and user-defined classes." msgstr "" "本教程的其他部分将利用各种示例,介绍 Python " "语言、系统的功能,开始只是简单的表达式、语句和数据类型,然后是函数、模块,最后,介绍一些高级概念,如,异常、用户定义的类等功能。"