@@ -28,52 +28,73 @@ msgid ""
2828"In Python, the special name ``__main__`` is used for two important "
2929"constructs:"
3030msgstr ""
31+ "در پایتون، از نام ویژهی ``__main__`` برای دو ساختار مهم "
32+ "استفاده میشود:"
3133
3234msgid ""
3335"the name of the top-level environment of the program, which can be checked "
3436"using the ``__name__ == '__main__'`` expression; and"
3537msgstr ""
38+ "نام محیط سطح بالای برنامه، که میتوان آن را با استفاده از عبارت "
39+ "``__name__ == '__main__'`` بررسی کرد؛ و"
3640
3741msgid "the ``__main__.py`` file in Python packages."
38- msgstr ""
42+ msgstr "فایل ``__main__.py`` در بستههای پایتون. "
3943
4044msgid ""
4145"Both of these mechanisms are related to Python modules; how users interact "
4246"with them and how they interact with each other. They are explained in "
4347"detail below. If you're new to Python modules, see the tutorial section :"
4448"ref:`tut-modules` for an introduction."
4549msgstr ""
50+ "هر دوی این مکانیزمها به ماژولهای پایتون مربوط میشوند؛ نحوهی تعامل کاربران "
51+ "با آنها و نحوهی تعامل آنها با یکدیگر. این موارد در "
52+ "جزئیات در زیر توضیح داده شدهاند. اگر با ماژولهای پایتون تازهکار هستید، برای آشنایی به بخش آموزش :"
53+ "ref:`tut-modules` مراجعه کنید."
4654
4755msgid "``__name__ == '__main__'``"
48- msgstr ""
56+ msgstr "``__name__ == '__main__'`` "
4957
5058msgid ""
5159"When a Python module or package is imported, ``__name__`` is set to the "
5260"module's name. Usually, this is the name of the Python file itself without "
5361"the ``.py`` extension::"
5462msgstr ""
63+ "هنگامی که یک ماژول یا بستهٔ پایتون ایمپورت میشود، ``__name__`` به "
64+ "نام ماژول تنظیم میشود. معمولاً این همان نام فایل پایتون است بدون "
65+ "پسوند ``.py``::"
5566
5667msgid ""
5768">>> import configparser\n"
5869">>> configparser.__name__\n"
5970"'configparser'"
6071msgstr ""
72+ ">>> import configparser\n"
73+ ">>> configparser.__name__\n"
74+ "'configparser'"
6175
6276msgid ""
6377"If the file is part of a package, ``__name__`` will also include the parent "
6478"package's path::"
6579msgstr ""
80+ "اگر فایل بخشی از یک بسته باشد، ``__name__`` همچنین مسیر بستهٔ والد را "
81+ "شامل خواهد شد::"
6682
6783msgid ""
6884">>> from concurrent.futures import process\n"
6985">>> process.__name__\n"
7086"'concurrent.futures.process'"
7187msgstr ""
88+ ">>> from concurrent.futures import process\n"
89+ ">>> process.__name__\n"
90+ "'concurrent.futures.process'"
7291
7392msgid ""
7493"However, if the module is executed in the top-level code environment, its "
7594"``__name__`` is set to the string ``'__main__'``."
7695msgstr ""
96+ "با این حال، اگر ماژول در محیط کد سطح بالا اجرا شود، "
97+ "``__name__`` آن به رشتهی ``'__main__'`` تنظیم میشود."
7798
7899msgid "What is the \" top-level code environment\" ?"
79100msgstr ""
0 commit comments