# Python Documentation Turkish Translation
# Copyright (C) 2001-2024, Python Software Foundation
# This file is distributed under the same license as the Python package.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-01 00:21+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: \n"
"Language-Team: TURKISH \n"
"Language: tr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: faq/library.rst:5
msgid "Library and Extension FAQ"
msgstr ""
#: faq/library.rst:8
msgid "Contents"
msgstr ""
#: faq/library.rst:12
msgid "General Library Questions"
msgstr ""
#: faq/library.rst:15
msgid "How do I find a module or application to perform task X?"
msgstr ""
#: faq/library.rst:17
msgid ""
"Check :ref:`the Library Reference ` to see if there's a "
"relevant standard library module. (Eventually you'll learn what's in the "
"standard library and will be able to skip this step.)"
msgstr ""
#: faq/library.rst:21
msgid ""
"For third-party packages, search the `Python Package Index `_ or try `Google `_ or another web search "
"engine. Searching for \"Python\" plus a keyword or two for your topic of "
"interest will usually find something helpful."
msgstr ""
#: faq/library.rst:28
msgid "Where is the math.py (socket.py, regex.py, etc.) source file?"
msgstr ""
#: faq/library.rst:30
msgid ""
"If you can't find a source file for a module it may be a built-in or "
"dynamically loaded module implemented in C, C++ or other compiled language. "
"In this case you may not have the source file or it may be something like :"
"file:`mathmodule.c`, somewhere in a C source directory (not on the Python "
"Path)."
msgstr ""
#: faq/library.rst:35
msgid "There are (at least) three kinds of modules in Python:"
msgstr ""
#: faq/library.rst:37
msgid "modules written in Python (.py);"
msgstr ""
#: faq/library.rst:38
msgid ""
"modules written in C and dynamically loaded (.dll, .pyd, .so, .sl, etc);"
msgstr ""
#: faq/library.rst:39
msgid ""
"modules written in C and linked with the interpreter; to get a list of "
"these, type::"
msgstr ""
#: faq/library.rst:42
msgid ""
"import sys\n"
"print(sys.builtin_module_names)"
msgstr ""
#: faq/library.rst:47
msgid "How do I make a Python script executable on Unix?"
msgstr ""
#: faq/library.rst:49
msgid ""
"You need to do two things: the script file's mode must be executable and the "
"first line must begin with ``#!`` followed by the path of the Python "
"interpreter."
msgstr ""
#: faq/library.rst:53
msgid ""
"The first is done by executing ``chmod +x scriptfile`` or perhaps ``chmod "
"755 scriptfile``."
msgstr ""
#: faq/library.rst:56
msgid ""
"The second can be done in a number of ways. The most straightforward way is "
"to write ::"
msgstr ""
#: faq/library.rst:59
msgid "#!/usr/local/bin/python"
msgstr ""
#: faq/library.rst:61
msgid ""
"as the very first line of your file, using the pathname for where the Python "
"interpreter is installed on your platform."
msgstr ""
#: faq/library.rst:64
msgid ""
"If you would like the script to be independent of where the Python "
"interpreter lives, you can use the :program:`env` program. Almost all Unix "
"variants support the following, assuming the Python interpreter is in a "
"directory on the user's :envvar:`PATH`::"
msgstr ""
#: faq/library.rst:69
msgid "#!/usr/bin/env python"
msgstr ""
#: faq/library.rst:71
msgid ""
"*Don't* do this for CGI scripts. The :envvar:`PATH` variable for CGI "
"scripts is often very minimal, so you need to use the actual absolute "
"pathname of the interpreter."
msgstr ""
#: faq/library.rst:75
msgid ""
"Occasionally, a user's environment is so full that the :program:`/usr/bin/"
"env` program fails; or there's no env program at all. In that case, you can "
"try the following hack (due to Alex Rezinsky):"
msgstr ""
#: faq/library.rst:79
msgid ""
"#! /bin/sh\n"
"\"\"\":\"\n"
"exec python $0 ${1+\"$@\"}\n"
"\"\"\""
msgstr ""
#: faq/library.rst:86
msgid ""
"The minor disadvantage is that this defines the script's __doc__ string. "
"However, you can fix that by adding ::"
msgstr ""
#: faq/library.rst:89
msgid "__doc__ = \"\"\"...Whatever...\"\"\""
msgstr ""
#: faq/library.rst:94
msgid "Is there a curses/termcap package for Python?"
msgstr ""
#: faq/library.rst:98
msgid ""
"For Unix variants: The standard Python source distribution comes with a "
"curses module in the :source:`Modules` subdirectory, though it's not "
"compiled by default. (Note that this is not available in the Windows "
"distribution -- there is no curses module for Windows.)"
msgstr ""
#: faq/library.rst:103
msgid ""
"The :mod:`curses` module supports basic curses features as well as many "
"additional functions from ncurses and SYSV curses such as colour, "
"alternative character set support, pads, and mouse support. This means the "
"module isn't compatible with operating systems that only have BSD curses, "
"but there don't seem to be any currently maintained OSes that fall into this "
"category."
msgstr ""
#: faq/library.rst:111
msgid "Is there an equivalent to C's onexit() in Python?"
msgstr ""
#: faq/library.rst:113
msgid ""
"The :mod:`atexit` module provides a register function that is similar to "
"C's :c:func:`!onexit`."
msgstr ""
#: faq/library.rst:118
msgid "Why don't my signal handlers work?"
msgstr ""
#: faq/library.rst:120
msgid ""
"The most common problem is that the signal handler is declared with the "
"wrong argument list. It is called as ::"
msgstr ""
#: faq/library.rst:123
msgid "handler(signum, frame)"
msgstr ""
#: faq/library.rst:125
msgid "so it should be declared with two parameters::"
msgstr ""
#: faq/library.rst:127
msgid ""
"def handler(signum, frame):\n"
" ..."
msgstr ""
#: faq/library.rst:132
msgid "Common tasks"
msgstr ""
#: faq/library.rst:135
msgid "How do I test a Python program or component?"
msgstr ""
#: faq/library.rst:137
msgid ""
"Python comes with two testing frameworks. The :mod:`doctest` module finds "
"examples in the docstrings for a module and runs them, comparing the output "
"with the expected output given in the docstring."
msgstr ""
#: faq/library.rst:141
msgid ""
"The :mod:`unittest` module is a fancier testing framework modelled on Java "
"and Smalltalk testing frameworks."
msgstr ""
#: faq/library.rst:144
msgid ""
"To make testing easier, you should use good modular design in your program. "
"Your program should have almost all functionality encapsulated in either "
"functions or class methods -- and this sometimes has the surprising and "
"delightful effect of making the program run faster (because local variable "
"accesses are faster than global accesses). Furthermore the program should "
"avoid depending on mutating global variables, since this makes testing much "
"more difficult to do."
msgstr ""
#: faq/library.rst:152
msgid "The \"global main logic\" of your program may be as simple as ::"
msgstr ""
#: faq/library.rst:154
msgid ""
"if __name__ == \"__main__\":\n"
" main_logic()"
msgstr ""
#: faq/library.rst:157
msgid "at the bottom of the main module of your program."
msgstr ""
#: faq/library.rst:159
msgid ""
"Once your program is organized as a tractable collection of function and "
"class behaviours, you should write test functions that exercise the "
"behaviours. A test suite that automates a sequence of tests can be "
"associated with each module. This sounds like a lot of work, but since "
"Python is so terse and flexible it's surprisingly easy. You can make coding "
"much more pleasant and fun by writing your test functions in parallel with "
"the \"production code\", since this makes it easy to find bugs and even "
"design flaws earlier."
msgstr ""
#: faq/library.rst:167
msgid ""
"\"Support modules\" that are not intended to be the main module of a program "
"may include a self-test of the module. ::"
msgstr ""
#: faq/library.rst:170
msgid ""
"if __name__ == \"__main__\":\n"
" self_test()"
msgstr ""
#: faq/library.rst:173
msgid ""
"Even programs that interact with complex external interfaces may be tested "
"when the external interfaces are unavailable by using \"fake\" interfaces "
"implemented in Python."
msgstr ""
#: faq/library.rst:179
msgid "How do I create documentation from doc strings?"
msgstr ""
#: faq/library.rst:181
msgid ""
"The :mod:`pydoc` module can create HTML from the doc strings in your Python "
"source code. An alternative for creating API documentation purely from "
"docstrings is `epydoc `_. `Sphinx `_ can also include docstring content."
msgstr ""
#: faq/library.rst:188
msgid "How do I get a single keypress at a time?"
msgstr ""
#: faq/library.rst:190
msgid ""
"For Unix variants there are several solutions. It's straightforward to do "
"this using curses, but curses is a fairly large module to learn."
msgstr ""
#: faq/library.rst:234
msgid "Threads"
msgstr ""
#: faq/library.rst:237
msgid "How do I program using threads?"
msgstr ""
#: faq/library.rst:239
msgid ""
"Be sure to use the :mod:`threading` module and not the :mod:`_thread` "
"module. The :mod:`threading` module builds convenient abstractions on top of "
"the low-level primitives provided by the :mod:`_thread` module."
msgstr ""
#: faq/library.rst:245
msgid "None of my threads seem to run: why?"
msgstr ""
#: faq/library.rst:247
msgid ""
"As soon as the main thread exits, all threads are killed. Your main thread "
"is running too quickly, giving the threads no time to do any work."
msgstr ""
#: faq/library.rst:250
msgid ""
"A simple fix is to add a sleep to the end of the program that's long enough "
"for all the threads to finish::"
msgstr ""
#: faq/library.rst:253
msgid ""
"import threading, time\n"
"\n"
"def thread_task(name, n):\n"
" for i in range(n):\n"
" print(name, i)\n"
"\n"
"for i in range(10):\n"
" T = threading.Thread(target=thread_task, args=(str(i), i))\n"
" T.start()\n"
"\n"
"time.sleep(10) # >> import urllib.parse\n"
">>> urllib.parse.urlencode({'name': 'Guy Steele, Jr.'})\n"
"'name=Guy+Steele%2C+Jr.'"
msgstr ""
#: faq/library.rst:704
msgid ":ref:`urllib-howto` for extensive examples."
msgstr ""
#: faq/library.rst:708
msgid "What module should I use to help with generating HTML?"
msgstr ""
#: faq/library.rst:712
msgid ""
"You can find a collection of useful links on the `Web Programming wiki page "
"`_."
msgstr ""
#: faq/library.rst:717
msgid "How do I send mail from a Python script?"
msgstr ""
#: faq/library.rst:719
msgid "Use the standard library module :mod:`smtplib`."
msgstr ""
#: faq/library.rst:721
msgid ""
"Here's a very simple interactive mail sender that uses it. This method will "
"work on any host that supports an SMTP listener. ::"
msgstr ""
#: faq/library.rst:724
msgid ""
"import sys, smtplib\n"
"\n"
"fromaddr = input(\"From: \")\n"
"toaddrs = input(\"To: \").split(',')\n"
"print(\"Enter message, end with ^D:\")\n"
"msg = ''\n"
"while True:\n"
" line = sys.stdin.readline()\n"
" if not line:\n"
" break\n"
" msg += line\n"
"\n"
"# The actual mail send\n"
"server = smtplib.SMTP('localhost')\n"
"server.sendmail(fromaddr, toaddrs, msg)\n"
"server.quit()"
msgstr ""
#: faq/library.rst:741
msgid ""
"A Unix-only alternative uses sendmail. The location of the sendmail program "
"varies between systems; sometimes it is ``/usr/lib/sendmail``, sometimes ``/"
"usr/sbin/sendmail``. The sendmail manual page will help you out. Here's "
"some sample code::"
msgstr ""
#: faq/library.rst:746
msgid ""
"import os\n"
"\n"
"SENDMAIL = \"/usr/sbin/sendmail\" # sendmail location\n"
"p = os.popen(\"%s -t -i\" % SENDMAIL, \"w\")\n"
"p.write(\"To: receiver@example.com\\n\")\n"
"p.write(\"Subject: test\\n\")\n"
"p.write(\"\\n\") # blank line separating headers from body\n"
"p.write(\"Some text\\n\")\n"
"p.write(\"some more text\\n\")\n"
"sts = p.close()\n"
"if sts != 0:\n"
" print(\"Sendmail exit status\", sts)"
msgstr ""
#: faq/library.rst:761
msgid "How do I avoid blocking in the connect() method of a socket?"
msgstr ""
#: faq/library.rst:763
msgid ""
"The :mod:`select` module is commonly used to help with asynchronous I/O on "
"sockets."
msgstr ""
#: faq/library.rst:766
msgid ""
"To prevent the TCP connect from blocking, you can set the socket to non-"
"blocking mode. Then when you do the :meth:`~socket.socket.connect`, you "
"will either connect immediately (unlikely) or get an exception that contains "
"the error number as ``.errno``. ``errno.EINPROGRESS`` indicates that the "
"connection is in progress, but hasn't finished yet. Different OSes will "
"return different values, so you're going to have to check what's returned on "
"your system."
msgstr ""
#: faq/library.rst:774
msgid ""
"You can use the :meth:`~socket.socket.connect_ex` method to avoid creating "
"an exception. It will just return the errno value. To poll, you can call :"
"meth:`~socket.socket.connect_ex` again later -- ``0`` or ``errno.EISCONN`` "
"indicate that you're connected -- or you can pass this socket to :meth:"
"`select.select` to check if it's writable."
msgstr ""
#: faq/library.rst:782
msgid ""
"The :mod:`asyncio` module provides a general purpose single-threaded and "
"concurrent asynchronous library, which can be used for writing non-blocking "
"network code. The third-party `Twisted `_ library is a "
"popular and feature-rich alternative."
msgstr ""
#: faq/library.rst:790
msgid "Databases"
msgstr ""
#: faq/library.rst:793
msgid "Are there any interfaces to database packages in Python?"
msgstr ""
#: faq/library.rst:795
msgid "Yes."
msgstr ""
#: faq/library.rst:797
msgid ""
"Interfaces to disk-based hashes such as :mod:`DBM ` and :mod:`GDBM "
"` are also included with standard Python. There is also the :mod:"
"`sqlite3` module, which provides a lightweight disk-based relational "
"database."
msgstr ""
#: faq/library.rst:802
msgid ""
"Support for most relational databases is available. See the "
"`DatabaseProgramming wiki page `_ for details."
msgstr ""
#: faq/library.rst:808
msgid "How do you implement persistent objects in Python?"
msgstr ""
#: faq/library.rst:810
msgid ""
"The :mod:`pickle` library module solves this in a very general way (though "
"you still can't store things like open files, sockets or windows), and the :"
"mod:`shelve` library module uses pickle and (g)dbm to create persistent "
"mappings containing arbitrary Python objects."
msgstr ""
#: faq/library.rst:817
msgid "Mathematics and Numerics"
msgstr ""
#: faq/library.rst:820
msgid "How do I generate random numbers in Python?"
msgstr ""
#: faq/library.rst:822
msgid ""
"The standard module :mod:`random` implements a random number generator. "
"Usage is simple::"
msgstr ""
#: faq/library.rst:825
msgid ""
"import random\n"
"random.random()"
msgstr ""
#: faq/library.rst:828
msgid "This returns a random floating-point number in the range [0, 1)."
msgstr ""
#: faq/library.rst:830
msgid ""
"There are also many other specialized generators in this module, such as:"
msgstr ""
#: faq/library.rst:832
msgid "``randrange(a, b)`` chooses an integer in the range [a, b)."
msgstr ""
#: faq/library.rst:833
msgid "``uniform(a, b)`` chooses a floating-point number in the range [a, b)."
msgstr ""
#: faq/library.rst:834
msgid ""
"``normalvariate(mean, sdev)`` samples the normal (Gaussian) distribution."
msgstr ""
#: faq/library.rst:836
msgid "Some higher-level functions operate on sequences directly, such as:"
msgstr ""
#: faq/library.rst:838
msgid "``choice(S)`` chooses a random element from a given sequence."
msgstr ""
#: faq/library.rst:839
msgid "``shuffle(L)`` shuffles a list in-place, i.e. permutes it randomly."
msgstr ""
#: faq/library.rst:841
msgid ""
"There's also a ``Random`` class you can instantiate to create independent "
"multiple random number generators."
msgstr ""