|
| 1 | +# SOME DESCRIPTIVE TITLE. |
| 2 | +# Copyright (C) 2001-2020, Python Software Foundation |
| 3 | +# This file is distributed under the same license as the Python package. |
| 4 | +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
| 5 | +# |
| 6 | +# Translators: |
| 7 | +# Stefan Ocetkiewicz <stefan.ocetkiewicz@gmail.com>, 2020 |
| 8 | +# |
| 9 | +#, fuzzy |
| 10 | +msgid "" |
| 11 | +msgstr "" |
| 12 | +"Project-Id-Version: Python 3.8\n" |
| 13 | +"Report-Msgid-Bugs-To: \n" |
| 14 | +"POT-Creation-Date: 2020-02-09 12:40+0000\n" |
| 15 | +"PO-Revision-Date: 2017-02-16 17:43+0000\n" |
| 16 | +"Last-Translator: Stefan Ocetkiewicz <stefan.ocetkiewicz@gmail.com>, 2020\n" |
| 17 | +"Language-Team: Polish (https://www.transifex.com/python-doc/teams/5390/pl/)\n" |
| 18 | +"MIME-Version: 1.0\n" |
| 19 | +"Content-Type: text/plain; charset=UTF-8\n" |
| 20 | +"Content-Transfer-Encoding: 8bit\n" |
| 21 | +"Language: pl\n" |
| 22 | +"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n" |
| 23 | +"%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n" |
| 24 | +"%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" |
| 25 | + |
| 26 | +msgid "Extending/Embedding FAQ" |
| 27 | +msgstr "" |
| 28 | + |
| 29 | +msgid "Contents" |
| 30 | +msgstr "Zawartość" |
| 31 | + |
| 32 | +msgid "Can I create my own functions in C?" |
| 33 | +msgstr "" |
| 34 | + |
| 35 | +msgid "" |
| 36 | +"Yes, you can create built-in modules containing functions, variables, " |
| 37 | +"exceptions and even new types in C. This is explained in the document :ref:" |
| 38 | +"`extending-index`." |
| 39 | +msgstr "" |
| 40 | + |
| 41 | +msgid "Most intermediate or advanced Python books will also cover this topic." |
| 42 | +msgstr "" |
| 43 | + |
| 44 | +msgid "Can I create my own functions in C++?" |
| 45 | +msgstr "" |
| 46 | + |
| 47 | +msgid "" |
| 48 | +"Yes, using the C compatibility features found in C++. Place ``extern \"C" |
| 49 | +"\" { ... }`` around the Python include files and put ``extern \"C\"`` before " |
| 50 | +"each function that is going to be called by the Python interpreter. Global " |
| 51 | +"or static C++ objects with constructors are probably not a good idea." |
| 52 | +msgstr "" |
| 53 | + |
| 54 | +msgid "Writing C is hard; are there any alternatives?" |
| 55 | +msgstr "" |
| 56 | + |
| 57 | +msgid "" |
| 58 | +"There are a number of alternatives to writing your own C extensions, " |
| 59 | +"depending on what you're trying to do." |
| 60 | +msgstr "" |
| 61 | + |
| 62 | +msgid "" |
| 63 | +"`Cython <http://cython.org>`_ and its relative `Pyrex <https://www.cosc." |
| 64 | +"canterbury.ac.nz/greg.ewing/python/Pyrex/>`_ are compilers that accept a " |
| 65 | +"slightly modified form of Python and generate the corresponding C code. " |
| 66 | +"Cython and Pyrex make it possible to write an extension without having to " |
| 67 | +"learn Python's C API." |
| 68 | +msgstr "" |
| 69 | + |
| 70 | +msgid "" |
| 71 | +"If you need to interface to some C or C++ library for which no Python " |
| 72 | +"extension currently exists, you can try wrapping the library's data types " |
| 73 | +"and functions with a tool such as `SWIG <http://www.swig.org>`_. `SIP " |
| 74 | +"<https://riverbankcomputing.com/software/sip/intro>`__, `CXX <http://cxx." |
| 75 | +"sourceforge.net/>`_ `Boost <http://www.boost.org/libs/python/doc/index." |
| 76 | +"html>`_, or `Weave <https://github.com/scipy/weave>`_ are also alternatives " |
| 77 | +"for wrapping C++ libraries." |
| 78 | +msgstr "" |
| 79 | + |
| 80 | +msgid "How can I execute arbitrary Python statements from C?" |
| 81 | +msgstr "" |
| 82 | + |
| 83 | +msgid "" |
| 84 | +"The highest-level function to do this is :c:func:`PyRun_SimpleString` which " |
| 85 | +"takes a single string argument to be executed in the context of the module " |
| 86 | +"``__main__`` and returns ``0`` for success and ``-1`` when an exception " |
| 87 | +"occurred (including :exc:`SyntaxError`). If you want more control, use :c:" |
| 88 | +"func:`PyRun_String`; see the source for :c:func:`PyRun_SimpleString` in " |
| 89 | +"``Python/pythonrun.c``." |
| 90 | +msgstr "" |
| 91 | + |
| 92 | +msgid "How can I evaluate an arbitrary Python expression from C?" |
| 93 | +msgstr "" |
| 94 | + |
| 95 | +msgid "" |
| 96 | +"Call the function :c:func:`PyRun_String` from the previous question with the " |
| 97 | +"start symbol :c:data:`Py_eval_input`; it parses an expression, evaluates it " |
| 98 | +"and returns its value." |
| 99 | +msgstr "" |
| 100 | + |
| 101 | +msgid "How do I extract C values from a Python object?" |
| 102 | +msgstr "" |
| 103 | + |
| 104 | +msgid "" |
| 105 | +"That depends on the object's type. If it's a tuple, :c:func:`PyTuple_Size` " |
| 106 | +"returns its length and :c:func:`PyTuple_GetItem` returns the item at a " |
| 107 | +"specified index. Lists have similar functions, :c:func:`PyListSize` and :c:" |
| 108 | +"func:`PyList_GetItem`." |
| 109 | +msgstr "" |
| 110 | + |
| 111 | +msgid "" |
| 112 | +"For bytes, :c:func:`PyBytes_Size` returns its length and :c:func:" |
| 113 | +"`PyBytes_AsStringAndSize` provides a pointer to its value and its length. " |
| 114 | +"Note that Python bytes objects may contain null bytes so C's :c:func:" |
| 115 | +"`strlen` should not be used." |
| 116 | +msgstr "" |
| 117 | + |
| 118 | +msgid "" |
| 119 | +"To test the type of an object, first make sure it isn't ``NULL``, and then " |
| 120 | +"use :c:func:`PyBytes_Check`, :c:func:`PyTuple_Check`, :c:func:" |
| 121 | +"`PyList_Check`, etc." |
| 122 | +msgstr "" |
| 123 | + |
| 124 | +msgid "" |
| 125 | +"There is also a high-level API to Python objects which is provided by the so-" |
| 126 | +"called 'abstract' interface -- read ``Include/abstract.h`` for further " |
| 127 | +"details. It allows interfacing with any kind of Python sequence using calls " |
| 128 | +"like :c:func:`PySequence_Length`, :c:func:`PySequence_GetItem`, etc. as well " |
| 129 | +"as many other useful protocols such as numbers (:c:func:`PyNumber_Index` et " |
| 130 | +"al.) and mappings in the PyMapping APIs." |
| 131 | +msgstr "" |
| 132 | + |
| 133 | +msgid "How do I use Py_BuildValue() to create a tuple of arbitrary length?" |
| 134 | +msgstr "" |
| 135 | + |
| 136 | +msgid "You can't. Use :c:func:`PyTuple_Pack` instead." |
| 137 | +msgstr "" |
| 138 | + |
| 139 | +msgid "How do I call an object's method from C?" |
| 140 | +msgstr "" |
| 141 | + |
| 142 | +msgid "" |
| 143 | +"The :c:func:`PyObject_CallMethod` function can be used to call an arbitrary " |
| 144 | +"method of an object. The parameters are the object, the name of the method " |
| 145 | +"to call, a format string like that used with :c:func:`Py_BuildValue`, and " |
| 146 | +"the argument values::" |
| 147 | +msgstr "" |
| 148 | + |
| 149 | +msgid "" |
| 150 | +"This works for any object that has methods -- whether built-in or user-" |
| 151 | +"defined. You are responsible for eventually :c:func:`Py_DECREF`\\ 'ing the " |
| 152 | +"return value." |
| 153 | +msgstr "" |
| 154 | + |
| 155 | +msgid "" |
| 156 | +"To call, e.g., a file object's \"seek\" method with arguments 10, 0 " |
| 157 | +"(assuming the file object pointer is \"f\")::" |
| 158 | +msgstr "" |
| 159 | + |
| 160 | +msgid "" |
| 161 | +"Note that since :c:func:`PyObject_CallObject` *always* wants a tuple for the " |
| 162 | +"argument list, to call a function without arguments, pass \"()\" for the " |
| 163 | +"format, and to call a function with one argument, surround the argument in " |
| 164 | +"parentheses, e.g. \"(i)\"." |
| 165 | +msgstr "" |
| 166 | + |
| 167 | +msgid "" |
| 168 | +"How do I catch the output from PyErr_Print() (or anything that prints to " |
| 169 | +"stdout/stderr)?" |
| 170 | +msgstr "" |
| 171 | + |
| 172 | +msgid "" |
| 173 | +"In Python code, define an object that supports the ``write()`` method. " |
| 174 | +"Assign this object to :data:`sys.stdout` and :data:`sys.stderr`. Call " |
| 175 | +"print_error, or just allow the standard traceback mechanism to work. Then, " |
| 176 | +"the output will go wherever your ``write()`` method sends it." |
| 177 | +msgstr "" |
| 178 | + |
| 179 | +msgid "The easiest way to do this is to use the :class:`io.StringIO` class:" |
| 180 | +msgstr "" |
| 181 | + |
| 182 | +msgid "A custom object to do the same would look like this:" |
| 183 | +msgstr "" |
| 184 | + |
| 185 | +msgid "How do I access a module written in Python from C?" |
| 186 | +msgstr "" |
| 187 | + |
| 188 | +msgid "You can get a pointer to the module object as follows::" |
| 189 | +msgstr "" |
| 190 | + |
| 191 | +msgid "" |
| 192 | +"If the module hasn't been imported yet (i.e. it is not yet present in :data:" |
| 193 | +"`sys.modules`), this initializes the module; otherwise it simply returns the " |
| 194 | +"value of ``sys.modules[\"<modulename>\"]``. Note that it doesn't enter the " |
| 195 | +"module into any namespace -- it only ensures it has been initialized and is " |
| 196 | +"stored in :data:`sys.modules`." |
| 197 | +msgstr "" |
| 198 | + |
| 199 | +msgid "" |
| 200 | +"You can then access the module's attributes (i.e. any name defined in the " |
| 201 | +"module) as follows::" |
| 202 | +msgstr "" |
| 203 | + |
| 204 | +msgid "" |
| 205 | +"Calling :c:func:`PyObject_SetAttrString` to assign to variables in the " |
| 206 | +"module also works." |
| 207 | +msgstr "" |
| 208 | + |
| 209 | +msgid "How do I interface to C++ objects from Python?" |
| 210 | +msgstr "" |
| 211 | + |
| 212 | +msgid "" |
| 213 | +"Depending on your requirements, there are many approaches. To do this " |
| 214 | +"manually, begin by reading :ref:`the \"Extending and Embedding\" document " |
| 215 | +"<extending-index>`. Realize that for the Python run-time system, there " |
| 216 | +"isn't a whole lot of difference between C and C++ -- so the strategy of " |
| 217 | +"building a new Python type around a C structure (pointer) type will also " |
| 218 | +"work for C++ objects." |
| 219 | +msgstr "" |
| 220 | + |
| 221 | +msgid "For C++ libraries, see :ref:`c-wrapper-software`." |
| 222 | +msgstr "" |
| 223 | + |
| 224 | +msgid "I added a module using the Setup file and the make fails; why?" |
| 225 | +msgstr "" |
| 226 | + |
| 227 | +msgid "" |
| 228 | +"Setup must end in a newline, if there is no newline there, the build process " |
| 229 | +"fails. (Fixing this requires some ugly shell script hackery, and this bug " |
| 230 | +"is so minor that it doesn't seem worth the effort.)" |
| 231 | +msgstr "" |
| 232 | + |
| 233 | +msgid "How do I debug an extension?" |
| 234 | +msgstr "" |
| 235 | + |
| 236 | +msgid "" |
| 237 | +"When using GDB with dynamically loaded extensions, you can't set a " |
| 238 | +"breakpoint in your extension until your extension is loaded." |
| 239 | +msgstr "" |
| 240 | + |
| 241 | +msgid "In your ``.gdbinit`` file (or interactively), add the command:" |
| 242 | +msgstr "" |
| 243 | + |
| 244 | +msgid "Then, when you run GDB:" |
| 245 | +msgstr "" |
| 246 | + |
| 247 | +msgid "" |
| 248 | +"I want to compile a Python module on my Linux system, but some files are " |
| 249 | +"missing. Why?" |
| 250 | +msgstr "" |
| 251 | + |
| 252 | +msgid "" |
| 253 | +"Most packaged versions of Python don't include the :file:`/usr/lib/python2." |
| 254 | +"{x}/config/` directory, which contains various files required for compiling " |
| 255 | +"Python extensions." |
| 256 | +msgstr "" |
| 257 | + |
| 258 | +msgid "For Red Hat, install the python-devel RPM to get the necessary files." |
| 259 | +msgstr "" |
| 260 | + |
| 261 | +msgid "For Debian, run ``apt-get install python-dev``." |
| 262 | +msgstr "" |
| 263 | + |
| 264 | +msgid "How do I tell \"incomplete input\" from \"invalid input\"?" |
| 265 | +msgstr "" |
| 266 | + |
| 267 | +msgid "" |
| 268 | +"Sometimes you want to emulate the Python interactive interpreter's behavior, " |
| 269 | +"where it gives you a continuation prompt when the input is incomplete (e.g. " |
| 270 | +"you typed the start of an \"if\" statement or you didn't close your " |
| 271 | +"parentheses or triple string quotes), but it gives you a syntax error " |
| 272 | +"message immediately when the input is invalid." |
| 273 | +msgstr "" |
| 274 | + |
| 275 | +msgid "" |
| 276 | +"In Python you can use the :mod:`codeop` module, which approximates the " |
| 277 | +"parser's behavior sufficiently. IDLE uses this, for example." |
| 278 | +msgstr "" |
| 279 | + |
| 280 | +msgid "" |
| 281 | +"The easiest way to do it in C is to call :c:func:`PyRun_InteractiveLoop` " |
| 282 | +"(perhaps in a separate thread) and let the Python interpreter handle the " |
| 283 | +"input for you. You can also set the :c:func:`PyOS_ReadlineFunctionPointer` " |
| 284 | +"to point at your custom input function. See ``Modules/readline.c`` and " |
| 285 | +"``Parser/myreadline.c`` for more hints." |
| 286 | +msgstr "" |
| 287 | + |
| 288 | +msgid "" |
| 289 | +"However sometimes you have to run the embedded Python interpreter in the " |
| 290 | +"same thread as your rest application and you can't allow the :c:func:" |
| 291 | +"`PyRun_InteractiveLoop` to stop while waiting for user input. The one " |
| 292 | +"solution then is to call :c:func:`PyParser_ParseString` and test for ``e." |
| 293 | +"error`` equal to ``E_EOF``, which means the input is incomplete. Here's a " |
| 294 | +"sample code fragment, untested, inspired by code from Alex Farber::" |
| 295 | +msgstr "" |
| 296 | + |
| 297 | +msgid "" |
| 298 | +"Another solution is trying to compile the received string with :c:func:" |
| 299 | +"`Py_CompileString`. If it compiles without errors, try to execute the " |
| 300 | +"returned code object by calling :c:func:`PyEval_EvalCode`. Otherwise save " |
| 301 | +"the input for later. If the compilation fails, find out if it's an error or " |
| 302 | +"just more input is required - by extracting the message string from the " |
| 303 | +"exception tuple and comparing it to the string \"unexpected EOF while parsing" |
| 304 | +"\". Here is a complete example using the GNU readline library (you may want " |
| 305 | +"to ignore **SIGINT** while calling readline())::" |
| 306 | +msgstr "" |
| 307 | + |
| 308 | +msgid "How do I find undefined g++ symbols __builtin_new or __pure_virtual?" |
| 309 | +msgstr "" |
| 310 | + |
| 311 | +msgid "" |
| 312 | +"To dynamically load g++ extension modules, you must recompile Python, relink " |
| 313 | +"it using g++ (change LINKCC in the Python Modules Makefile), and link your " |
| 314 | +"extension module using g++ (e.g., ``g++ -shared -o mymodule.so mymodule.o``)." |
| 315 | +msgstr "" |
| 316 | + |
| 317 | +msgid "" |
| 318 | +"Can I create an object class with some methods implemented in C and others " |
| 319 | +"in Python (e.g. through inheritance)?" |
| 320 | +msgstr "" |
| 321 | + |
| 322 | +msgid "" |
| 323 | +"Yes, you can inherit from built-in classes such as :class:`int`, :class:" |
| 324 | +"`list`, :class:`dict`, etc." |
| 325 | +msgstr "" |
| 326 | + |
| 327 | +msgid "" |
| 328 | +"The Boost Python Library (BPL, http://www.boost.org/libs/python/doc/index." |
| 329 | +"html) provides a way of doing this from C++ (i.e. you can inherit from an " |
| 330 | +"extension class written in C++ using the BPL)." |
| 331 | +msgstr "" |
0 commit comments