# Copyright (C) 2001 Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: # Liang-Bo Wang , 2015-2016 # Liang-Bo Wang , 2016 msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-09-24 00:11+0000\n" "PO-Revision-Date: 2021-10-03 17:39+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 2.4.3\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 "" "如果你經常在電腦上工作,最終總能發現有些工作你會想要自動化。舉例來說,你會想" "在很多文字檔案裡做相同的搜尋取代,或者是用個複雜的規則重新命名或整理一群照" "片。也有可能你想寫個自己的小資料庫,一個專門的 GUI 應用程式,或一個小遊戲。" #: ../../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 腳本最適合於搬動檔案或更動文字內容,而不適於圖形應用程式或遊戲。你可以" "為此寫個 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 更豐富的錯誤檢查。相較於 C," "Python 作為一個「非常高階的程式語言」,它內建了高階的資料型別如彈性的陣列與字" "典。因為這些多用途的資料型別,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 允許你把程式切割成許多模組 (module) 並將他們重複運用至其他 Python 程式" "中。Python 自帶了一個很大集合的標準模組,它們能做為你程式的基礎——或把它們當作" "一開始學寫 Python 程式的範例。有些模組提供了如檔案 I/O、系統呼叫、socket 的功" "能,甚至提供了 Tk 等圖形介面工具庫 (GUI toolkit) 的介面。" #: ../../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 讓程式寫得精簡並易讀。用 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 "Python 高階的資料型別能在一陳述式 (statement) 中表達很複雜的操作;" #: ../../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 連結到一些僅以二進位形式 (binary form) 釋出的程式庫(例如特定供應商的" "繪圖程式庫)。如果你想更多這樣的結合,你其實也可以把 Python 直譯器連結到用 C " "寫的應用程式,並在該應用程式中使用 Python 寫擴充或者作為下達指令的語言。" #: ../../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's Flying Circus》命名,與爬蟲" "類完全沒有關係。在說明文件中引用他們的喜劇不但沒問題,這甚至是個被鼓勵的行" "為!" #: ../../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 語言與其系統的諸多特色。一開始是" "簡單的運算式 (expression)、陳述式 (statement) 和資料型別 (data type);接著是" "函式 (function) 與模組 (module);最後會接觸一些較進階的主題如例外 " "(exception) 與使用者定義類別 (class)。"