# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001 Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: # Revisto , 2025 # Sepehr Rasouli , 2026 # arman mohebali , 2026 # Farid Farahani , 2026 # msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-10-10 04:18+0000\n" "PO-Revision-Date: 2026-09-24 07:53+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/)\n" "Language: fa\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Generator: Poedit 3.6\n" msgid ":mod:`!code` --- Interpreter base classes" msgstr ":mod:`!code` --- کلاس‌های پایه مفسر" msgid "**Source code:** :source:`Lib/code.py`" msgstr "**کد منبع:** :source:`Lib/code.py`" msgid "The ``code`` module provides facilities to implement read-eval-print loops in Python. Two classes and convenience functions are included which can be used to build applications which provide an interactive interpreter prompt." msgstr "ماژول ``code`` امکاناتی برای پیاده‌سازی حلقه‌های خواندن-ارزیابی-چاپ (REPL) در پایتون فراهم می‌کند. دو کلاس و توابع کمکی گنجانده شده‌اند که می‌توان از آن‌ها برای ساخت برنامه‌هایی استفاده کرد که اعلان مفسر تعاملی را ارائه می‌دهند." msgid "This class deals with parsing and interpreter state (the user's namespace); it does not deal with input buffering or prompting or input file naming (the filename is always passed in explicitly). The optional *locals* argument specifies a mapping to use as the namespace in which code will be executed; it defaults to a newly created dictionary with key ``'__name__'`` set to ``'__console__'`` and key ``'__doc__'`` set to ``None``." msgstr "این کلاس به تجزیه و وضعیت مفسر (فضای نام کاربر) می‌پردازد؛ به بافر کردن ورودی، نمایش اعلان یا نام‌گذاری پرونده ورودی نمی‌پردازد (نام پرونده همیشه به‌صورت صریح ارسال می‌شود). آرگومان اختیاری *locals* نگاشتی را برای استفاده به‌عنوان فضای نامی که کد در آن اجرا خواهد شد مشخص می‌کند؛ مقدار پیش‌فرض آن یک دیکشنری تازه‌ساخته است که در آن کلید ``'__name__'`` روی ``'__console__'`` و کلید ``'__doc__'`` روی ``None`` تنظیم شده است." msgid "Note that functions and classes objects created under an :class:`!InteractiveInterpreter` instance will belong to the namespace specified by *locals*. They are only pickleable if *locals* is the namespace of an existing module." msgstr "توجه داشته باشید که اشیای توابع و کلاس‌های ایجادشده تحت یک نمونه :class:`!InteractiveInterpreter` به فضای نام مشخص‌شده توسط *locals* تعلق خواهند داشت. آن‌ها تنها در صورتی قابل پیکل (pickleable) هستند که *locals* فضای نام یک ماژول موجود باشد." msgid "Closely emulate the behavior of the interactive Python interpreter. This class builds on :class:`InteractiveInterpreter` and adds prompting using the familiar ``sys.ps1`` and ``sys.ps2``, and input buffering. If *local_exit* is true, ``exit()`` and ``quit()`` in the console will not raise :exc:`SystemExit`, but instead return to the calling code." msgstr "به‌دقت رفتار مفسر تعاملی پایتون را شبیه‌سازی می‌کند. این کلاس بر پایه :class:`InteractiveInterpreter` ساخته شده و اعلان‌دهی با استفاده از ``sys.ps1`` و ``sys.ps2`` آشنا و همچنین بافرینگ ورودی را اضافه می‌کند. اگر *local_exit* درست باشد، ``exit()`` و ``quit()`` در کنسول :exc:`SystemExit` را پرتاب نمی‌کنند، بلکه به کد فراخوان بازمی‌گردند." msgid "Added *local_exit* parameter." msgstr "پارامتر *local_exit* افزوده شد." msgid "Convenience function to run a read-eval-print loop. This creates a new instance of :class:`InteractiveConsole` and sets *readfunc* to be used as the :meth:`InteractiveConsole.raw_input` method, if provided. If *local* is provided, it is passed to the :class:`InteractiveConsole` constructor for use as the default namespace for the interpreter loop. If *local_exit* is provided, it is passed to the :class:`InteractiveConsole` constructor. The :meth:`~InteractiveConsole.interact` method of the instance is then run with *banner* and *exitmsg* passed as the banner and exit message to use, if provided. The console object is discarded after use." msgstr "تابعی برای سهولت اجرای حلقه‌ی خواندن-ارزیابی-چاپ. این تابع یک نمونه‌ی جدید از :class:`InteractiveConsole` ایجاد می‌کند و، در صورت ارائه‌شدن *readfunc*، آن را تنظیم می‌کند تا به‌عنوان متد :meth:`InteractiveConsole.raw_input` استفاده شود. اگر *local* ارائه‌شده باشد، به سازنده‌ی :class:`InteractiveConsole` ارسال می‌شود تا به‌عنوان فضای نام پیش‌فرض برای حلقه‌ی مفسر استفاده شود. اگر *local_exit* ارائه‌شده باشد، به سازنده‌ی :class:`InteractiveConsole` ارسال می‌شود. سپس متد :meth:`~InteractiveConsole.interact` این نمونه اجرا می‌شود، درحالی‌که *banner* و *exitmsg*، در صورت ارائه‌شدن، به‌عنوان بنر و پیام خروج برای استفاده ارسال می‌شوند. شیء کنسول پس از استفاده دور انداخته می‌شود." msgid "Added *exitmsg* parameter." msgstr "پارامتر *exitmsg* اضافه شد." msgid "This function is useful for programs that want to emulate Python's interpreter main loop (a.k.a. the read-eval-print loop). The tricky part is to determine when the user has entered an incomplete command that can be completed by entering more text (as opposed to a complete command or a syntax error). This function *almost* always makes the same decision as the real interpreter main loop." msgstr "این تابع برای برنامه‌هایی مفید است که می‌خواهند حلقه‌ی اصلی مفسر پایتون (معروف به حلقه‌ی خواندن-ارزیابی-چاپ) را شبیه‌سازی کنند. بخش دشوار، تشخیص این موضوع است که کاربر چه زمانی یک دستور ناقص وارد کرده است که می‌توان آن را با وارد کردن متن بیشتر کامل کرد (در مقابل یک دستور کامل یا یک خطای سینتکسی). این تابع *تقریباً* همیشه همان تصمیمی را می‌گیرد که حلقه‌ی اصلی واقعی مفسر می‌گیرد." msgid "*source* is the source string; *filename* is the optional filename from which source was read, defaulting to ``''``; and *symbol* is the optional grammar start symbol, which should be ``'single'`` (the default), ``'eval'`` or ``'exec'``." msgstr "*source* رشته منبع است؛ *filename* نام پرونده اختیاری است که منبع از آن خوانده شده است، با پیش‌فرض ``''``؛ و *symbol* نماد شروع اختیاری دستور زبان است که باید ``'single'`` (پیش‌فرض)، ``'eval'`` یا ``'exec'`` باشد." msgid "Returns a code object (the same as ``compile(source, filename, symbol)``) if the command is complete and valid; ``None`` if the command is incomplete; raises :exc:`SyntaxError` if the command is complete and contains a syntax error, or raises :exc:`OverflowError` or :exc:`ValueError` if the command contains an invalid literal." msgstr "اگر دستور کامل و معتبر باشد، یک شیء کد (همانند ``compile(source, filename, symbol)``) را بازمی‌گرداند؛ اگر دستور ناتمام باشد، ``None`` را بازمی‌گرداند؛ اگر دستور کامل باشد و حاوی خطای سینتکسی باشد، :exc:`SyntaxError` را پرتاب می‌کند، یا اگر دستور حاوی یک لفظی نامعتبر باشد، :exc:`OverflowError` یا :exc:`ValueError` را پرتاب می‌کند." msgid "Interactive Interpreter Objects" msgstr "اشیای مفسر تعاملی" msgid "Compile and run some source in the interpreter. Arguments are the same as for :func:`compile_command`; the default for *filename* is ``''``, and for *symbol* is ``'single'``. One of several things can happen:" msgstr "مقداری کد منبع را در مفسر کامپایل و اجرا می‌کند. آرگومان‌ها همان آرگومان‌های :func:`compile_command` هستند؛ پیش‌فرض برای *filename* برابر ``''`` و برای *symbol* برابر ``'single'`` است. یکی از چند حالت ممکن است رخ دهد:" msgid "The input is incorrect; :func:`compile_command` raised an exception (usually :exc:`SyntaxError`). A syntax traceback will be printed by calling the :meth:`showsyntaxerror` method. :meth:`runsource` returns ``False``." msgstr "ورودی نادرست است؛ :func:`compile_command` یک استثنا (معمولاً از نوع :exc:`SyntaxError`) را بالا آورد. یک ردگیری نحوی با فراخوانی متد :meth:`showsyntaxerror` چاپ خواهد شد. :meth:`runsource` مقدار ``False`` را برمی‌گرداند." msgid "The input is incomplete, and more input is required; :func:`compile_command` returned ``None``. :meth:`runsource` returns ``True``." msgstr "ورودی ناقص است و به ورودی بیشتری نیاز است؛ :func:`compile_command` ``None`` را برگرداند. :meth:`runsource` ``True`` را برمی‌گرداند." msgid "The input is complete; :func:`compile_command` returned a code object. The code is executed by calling the :meth:`runcode` (which also handles run-time exceptions, except for :exc:`SystemExit`). :meth:`runsource` returns ``False``." msgstr "ورودی کامل است؛ :func:`compile_command` یک شیء کد برگرداند. کد با فراخوانی :meth:`runcode` اجرا می‌شود (که استثناهای ران‌تایم را نیز مدیریت می‌کند، به‌جز :exc:`SystemExit`). :meth:`runsource` ``False`` را برمی‌گرداند." msgid "The return value can be used to decide whether to use ``sys.ps1`` or ``sys.ps2`` to prompt the next line." msgstr "می‌توان از مقدار بازگشتی برای تصمیم‌گیری درباره‌ی استفاده از ``sys.ps1`` یا ``sys.ps2`` به‌عنوان اعلان خط بعدی استفاده کرد." msgid "Execute a code object. When an exception occurs, :meth:`showtraceback` is called to display a traceback. All exceptions are caught except :exc:`SystemExit`, which is allowed to propagate." msgstr "یک شیء کد را اجرا می‌کند. هنگامی که یک استثنا رخ می‌دهد، :meth:`showtraceback` برای نمایش یک ردگیری پشته فراخوانی می‌شود. همه‌ی استثناها گرفته می‌شوند، به‌جز :exc:`SystemExit`، که اجازه دارد منتشر شود." msgid "A note about :exc:`KeyboardInterrupt`: this exception may occur elsewhere in this code, and may not always be caught. The caller should be prepared to deal with it." msgstr "نکته‌ای در مورد :exc:`KeyboardInterrupt`: این استثنا ممکن است در جاهای دیگری از این کد رخ دهد و ممکن است همیشه گرفته نشود. فراخواننده باید برای رسیدگی به آن آماده باشد." msgid "Display the syntax error that just occurred. This does not display a stack trace because there isn't one for syntax errors. If *filename* is given, it is stuffed into the exception instead of the default filename provided by Python's parser, because it always uses ``''`` when reading from a string. The output is written by the :meth:`write` method." msgstr "خطای سینتکسی‌ای را که به‌تازگی رخ داده است نمایش می‌دهد. این کار ردگیری پشته را نمایش نمی‌دهد، زیرا برای خطاهای سینتکسی هیچ ردگیری پشته‌ای وجود ندارد. اگر *filename* داده شود، این نام به‌جای نام پرونده پیش‌فرض ارائه‌شده توسط پارسر پایتون در استثنا گنجانده می‌شود، زیرا آن پارسر همیشه هنگام خواندن از یک رشته از ``''`` استفاده می‌کند. خروجی توسط متد :meth:`write` نوشته می‌شود." msgid "Display the exception that just occurred. We remove the first stack item because it is within the interpreter object implementation. The output is written by the :meth:`write` method." msgstr "استثنایی را که به‌تازگی رخ داده است نمایش می‌دهیم. نخستین آیتم پشته را حذف می‌کنیم، زیرا درون پیاده‌سازی شیء مفسر قرار دارد. خروجی توسط متد :meth:`write` نوشته می‌شود." msgid "The full chained traceback is displayed instead of just the primary traceback." msgstr "ردگیری پشته زنجیره‌ای کامل به‌جای تنها ردگیری پشته اصلی نمایش داده می‌شود." msgid "Write a string to the standard error stream (``sys.stderr``). Derived classes should override this to provide the appropriate output handling as needed." msgstr "یک رشته را در جریان خطای استاندارد (``sys.stderr``) می‌نویسد. کلاس‌های مشتق‌شده باید این متد را بازنویسی کنند تا در صورت نیاز، پردازش خروجی مناسب را فراهم کنند." msgid "Interactive Console Objects" msgstr "اشیای کنسول تعاملی" msgid "The :class:`InteractiveConsole` class is a subclass of :class:`InteractiveInterpreter`, and so offers all the methods of the interpreter objects as well as the following additions." msgstr "کلاس :class:`InteractiveConsole` زیرکلاسی از :class:`InteractiveInterpreter` است، بنابراین همه‌ی متدهای اشیای مفسر و همچنین موارد افزودنی زیر را ارائه می‌دهد." msgid "Closely emulate the interactive Python console. The optional *banner* argument specify the banner to print before the first interaction; by default it prints a banner similar to the one printed by the standard Python interpreter, followed by the class name of the console object in parentheses (so as not to confuse this with the real interpreter -- since it's so close!)." msgstr "تا حد زیادی کنسول تعاملی پایتون را شبیه‌سازی می‌کند. آرگومان اختیاری *banner* بنری را مشخص می‌کند که پیش از نخستین تعامل چاپ می‌شود؛ به‌طور پیش‌فرض، بنری مشابه بنر چاپ‌شده توسط مفسر استاندارد پایتون را چاپ می‌کند و پس از آن، نام کلاس شیء کنسول در پرانتز می‌آید (تا با مفسر واقعی اشتباه گرفته نشود — چون بسیار نزدیک است!)." msgid "The optional *exitmsg* argument specifies an exit message printed when exiting. Pass the empty string to suppress the exit message. If *exitmsg* is not given or ``None``, a default message is printed." msgstr "آرگومان اختیاری *exitmsg* یک پیام خروج را مشخص می‌کند که هنگام خروج چاپ می‌شود. برای جلوگیری از چاپ پیام خروج، رشته خالی را بدهید. اگر *exitmsg* داده نشود یا ``None`` باشد، یک پیام پیش‌فرض چاپ می‌شود." msgid "To suppress printing any banner, pass an empty string." msgstr "برای جلوگیری از چاپ هرگونه بنر، یک رشته خالی ارسال کنید." msgid "Print an exit message when exiting." msgstr "هنگام خروج، یک پیام خروج چاپ می‌شود." msgid "Push a line of source text to the interpreter. The line should not have a trailing newline; it may have internal newlines. The line is appended to a buffer and the interpreter's :meth:`~InteractiveInterpreter.runsource` method is called with the concatenated contents of the buffer as source. If this indicates that the command was executed or invalid, the buffer is reset; otherwise, the command is incomplete, and the buffer is left as it was after the line was appended. The return value is ``True`` if more input is required, ``False`` if the line was dealt with in some way (this is the same as :meth:`!runsource`)." msgstr "یک خط از متن منبع را به مفسر ارسال کنید. خط نباید به نویسه‌ی خط جدید ختم شود؛ ممکن است شامل نویسه‌های خط جدید داخلی باشد. خط به یک بافر افزوده می‌شود و متد :meth:`~InteractiveInterpreter.runsource` مفسر با محتوای به‌هم‌پیوسته‌ی بافر به‌عنوان منبع فراخوانی می‌شود. اگر این نشان دهد که دستور اجراشده یا نامعتبر است، بافر بازنشانی می‌شود؛ در غیر این صورت، دستور ناقص است و بافر به همان حالت پس از افزودن خط باقی می‌ماند. مقدار بازگشتی در صورتی ``True`` است که به ورودی بیشتری نیاز باشد، و در صورتی ``False`` است که خط به شکلی پردازش‌شده باشد (این همانند :meth:`!runsource` است)." msgid "Remove any unhandled source text from the input buffer." msgstr "هرگونه متن منبع پردازش‌نشده را از بافر ورودی حذف کنید." msgid "Write a prompt and read a line. The returned line does not include the trailing newline. When the user enters the EOF key sequence, :exc:`EOFError` is raised. The base implementation reads from ``sys.stdin``; a subclass may replace this with a different implementation." msgstr "یک اعلان را می‌نویسد و یک خط را می‌خواند. خط برگردانده‌شده شامل نویسه‌ی خط جدید پایانی نیست. هنگامی که کاربر دنباله‌ی کلیدهای EOF را وارد کند، :exc:`EOFError` پرتاب می‌شود. پیاده‌سازی پایه از ``sys.stdin`` می‌خواند؛ یک زیرکلاس می‌تواند این را با پیاده‌سازی متفاوتی جایگزین کند."