@@ -69,21 +69,19 @@ msgid ""
6969msgstr "수행하려는 작업에 따라, 여러분 만의 C 확장을 작성하는 여러 가지 대안이 있습니다."
7070
7171#: ../../faq/extending.rst:44
72- #, fuzzy
7372msgid ""
7473"`Cython <https://cython.org>`_ and its relative `Pyrex "
7574"<https://www.csse.canterbury.ac.nz/greg.ewing/python/Pyrex/>`_ are "
7675"compilers that accept a slightly modified form of Python and generate the"
7776" corresponding C code. Cython and Pyrex make it possible to write an "
7877"extension without having to learn Python's C API."
7978msgstr ""
80- "`Cython <http ://cython.org>`_\\ 과 관련 `Pyrex "
81- "<https://www.cosc .canterbury.ac.nz/greg.ewing/python/Pyrex/>`_\\ 는 약간 수정된 "
79+ "`Cython <https ://cython.org>`_\\ 과 관련 `Pyrex "
80+ "<https://www.csse .canterbury.ac.nz/greg.ewing/python/Pyrex/>`_\\ 는 약간 수정된 "
8281"파이썬 형식을 받아들이고 해당 C 코드를 생성하는 컴파일러입니다. Cython과 Pyrex를 사용하면 파이썬의 C API를 배우지 "
8382"않고도 확장을 작성할 수 있습니다."
8483
8584#: ../../faq/extending.rst:50
86- #, fuzzy
8785msgid ""
8886"If you need to interface to some C or C++ library for which no Python "
8987"extension currently exists, you can try wrapping the library's data types"
@@ -95,10 +93,9 @@ msgid ""
9593" libraries."
9694msgstr ""
9795"현재 파이썬 확장이 없는 일부 C나 C++ 라이브러리에 대한 인터페이스가 필요하면, 라이브러리의 데이터형과 함수를 `SWIG "
98- "<http://www.swig.org>`_\\ 과 같은 도구로 래핑할 수 있습니다. `SIP "
99- "<https://riverbankcomputing.com/software/sip/intro>`__, `CXX "
100- "<http://cxx.sourceforge.net/>`_, `Boost "
101- "<http://www.boost.org/libs/python/doc/index.html>`_ 또는 `Weave "
96+ "<https://www.swig.org>`_\\ 과 같은 도구로 래핑할 수 있습니다. `SIP <https://github.com"
97+ "/Python-SIP/sip>`__, `CXX <https://cxx.sourceforge.net/>`_, `Boost "
98+ "<https://www.boost.org/libs/python/doc/index.html>`_ 또는 `Weave "
10299"<https://github.com/scipy/weave>`_\\ 도 C++ 라이브러리 래핑의 대안입니다."
103100
104101#: ../../faq/extending.rst:61
@@ -138,7 +135,6 @@ msgid "How do I extract C values from a Python object?"
138135msgstr "파이썬 객체에서 C값을 어떻게 추출합니까?"
139136
140137#: ../../faq/extending.rst:82
141- #, fuzzy
142138msgid ""
143139"That depends on the object's type. If it's a tuple, "
144140":c:func:`PyTuple_Size` returns its length and :c:func:`PyTuple_GetItem` "
@@ -147,10 +143,9 @@ msgid ""
147143msgstr ""
148144"이는 객체의 형에 따라 다릅니다. 튜플이면, :c:func:`PyTuple_Size`\\ 는 길이를 반환하고 "
149145":c:func:`PyTuple_GetItem`\\ 은 지정된 인덱스의 항목을 반환합니다. 리스트는 비슷한 함수를 가지고 있습니다, "
150- ":c:func:`PyListSize `\\ 와 :c:func:`PyList_GetItem`."
146+ ":c:func:`PyList_Size `\\ 와 :c:func:`PyList_GetItem`."
151147
152148#: ../../faq/extending.rst:87
153- #, fuzzy
154149msgid ""
155150"For bytes, :c:func:`PyBytes_Size` returns its length and "
156151":c:func:`PyBytes_AsStringAndSize` provides a pointer to its value and its"
@@ -159,7 +154,7 @@ msgid ""
159154msgstr ""
160155"바이트열에서는, :c:func:`PyBytes_Size`\\ 는 길이를 반환하고 "
161156":c:func:`PyBytes_AsStringAndSize`\\ 는 값과 길이에 대한 포인터를 제공합니다. 파이썬 바이트열 객체는 "
162- "널(null) 바이트를 포함할 수 있어서 C의 :c:func:`strlen`\\ 을 사용할 수 없음에 유의하십시오."
157+ "널(null) 바이트를 포함할 수 있어서 C의 :c:func:`! strlen`\\ 을 사용할 수 없음에 유의하십시오."
163158
164159#: ../../faq/extending.rst:92
165160msgid ""
@@ -214,6 +209,9 @@ msgid ""
214209"PyObject_CallMethod(PyObject *object, const char *method_name,\n"
215210" const char *arg_format, ...);"
216211msgstr ""
212+ "PyObject *\n"
213+ "PyObject_CallMethod(PyObject *object, const char *method_name,\n"
214+ " const char *arg_format, ...);"
217215
218216#: ../../faq/extending.rst:121
219217msgid ""
@@ -241,6 +239,13 @@ msgid ""
241239" Py_DECREF(res);\n"
242240"}"
243241msgstr ""
242+ "res = PyObject_CallMethod(f, \" seek\" , \" (ii)\" , 10, 0);\n"
243+ "if (res == NULL) {\n"
244+ " ... an exception occurred ...\n"
245+ "}\n"
246+ "else {\n"
247+ " Py_DECREF(res);\n"
248+ "}"
244249
245250#: ../../faq/extending.rst:135
246251msgid ""
@@ -284,6 +289,13 @@ msgid ""
284289"foo\n"
285290"hello world!"
286291msgstr ""
292+ ">>> import io, sys\n"
293+ ">>> sys.stdout = io.StringIO()\n"
294+ ">>> print('foo')\n"
295+ ">>> print('hello world!')\n"
296+ ">>> sys.stderr.write(sys.stdout.getvalue())\n"
297+ "foo\n"
298+ "hello world!"
287299
288300#: ../../faq/extending.rst:161
289301msgid "A custom object to do the same would look like this:"
@@ -306,6 +318,20 @@ msgid ""
306318"foo\n"
307319"hello world!"
308320msgstr ""
321+ ">>> import io, sys\n"
322+ ">>> class StdoutCatcher(io.TextIOBase):\n"
323+ "... def __init__(self):\n"
324+ "... self.data = []\n"
325+ "... def write(self, stuff):\n"
326+ "... self.data.append(stuff)\n"
327+ "...\n"
328+ ">>> import sys\n"
329+ ">>> sys.stdout = StdoutCatcher()\n"
330+ ">>> print('foo')\n"
331+ ">>> print('hello world!')\n"
332+ ">>> sys.stderr.write(''.join(sys.stdout.data))\n"
333+ "foo\n"
334+ "hello world!"
309335
310336#: ../../faq/extending.rst:182
311337msgid "How do I access a module written in Python from C?"
@@ -317,7 +343,7 @@ msgstr "다음과 같이 모듈 객체에 대한 포인터를 얻을 수 있습
317343
318344#: ../../faq/extending.rst:186
319345msgid "module = PyImport_ImportModule(\" <modulename>\" );"
320- msgstr ""
346+ msgstr "module = PyImport_ImportModule( \" <modulename> \" ); "
321347
322348#: ../../faq/extending.rst:188
323349msgid ""
@@ -339,7 +365,7 @@ msgstr "그런 다음, 다음과 같이 모듈의 어트리뷰트(즉 모듈에
339365
340366#: ../../faq/extending.rst:197
341367msgid "attr = PyObject_GetAttrString(module, \" <attrname>\" );"
342- msgstr ""
368+ msgstr "attr = PyObject_GetAttrString(module, \" <attrname> \" ); "
343369
344370#: ../../faq/extending.rst:199
345371msgid ""
@@ -398,7 +424,7 @@ msgstr "``.gdbinit`` 파일에서 (또는 대화식으로) 다음 명령을 추
398424
399425#: ../../faq/extending.rst:231
400426msgid "br _PyImport_LoadDynamicModule"
401- msgstr ""
427+ msgstr "br _PyImport_LoadDynamicModule "
402428
403429#: ../../faq/extending.rst:235
404430msgid "Then, when you run GDB:"
@@ -413,6 +439,12 @@ msgid ""
413439"gdb) br myfunction.c:50\n"
414440"gdb) continue"
415441msgstr ""
442+ "$ gdb /local/bin/python\n"
443+ "gdb) run myscript.py\n"
444+ "gdb) continue # repeat until your extension is loaded\n"
445+ "gdb) finish # so that your extension is loaded\n"
446+ "gdb) br myfunction.c:50\n"
447+ "gdb) continue"
416448
417449#: ../../faq/extending.rst:247
418450msgid ""
@@ -421,23 +453,18 @@ msgid ""
421453msgstr "리눅스 시스템에서 파이썬 모듈을 컴파일하고 싶지만, 일부 파일이 없습니다. 왜 그렇습니까?"
422454
423455#: ../../faq/extending.rst:249
424- #, fuzzy , python-brace-format
425456msgid ""
426457"Most packaged versions of Python omit some files required for compiling "
427458"Python extensions."
428- msgstr ""
429- "대부분의 포장된 버전의 파이썬은 파이썬 확장을 컴파일하는 데 필요한 다양한 파일이 포함된 "
430- ":file:`/usr/lib/python2.{x}/config/` 디렉터리가 포함되어 있지 않습니다."
459+ msgstr "대부분의 포장된 버전의 파이썬은 파이썬 확장을 컴파일하는 데 필요한 일부 파일을 생략하고 있습니다."
431460
432461#: ../../faq/extending.rst:252
433- #, fuzzy
434462msgid "For Red Hat, install the python3-devel RPM to get the necessary files."
435- msgstr "레드햇의 경우, 필요한 파일을 얻으려면 python -devel RPM을 설치하십시오."
463+ msgstr "레드햇의 경우, 필요한 파일을 얻으려면 python3 -devel RPM을 설치하십시오."
436464
437465#: ../../faq/extending.rst:254
438- #, fuzzy
439466msgid "For Debian, run ``apt-get install python3-dev``."
440- msgstr "데비안의 경우, ``apt-get install python -dev``\\ 를 실행하십시오."
467+ msgstr "데비안의 경우, ``apt-get install python3 -dev``\\ 를 실행하십시오."
441468
442469#: ../../faq/extending.rst:257
443470msgid "How do I tell \" incomplete input\" from \" invalid input\" ?"
@@ -508,67 +535,12 @@ msgstr ""
508535"있습니다."
509536
510537#: ../../faq/extending.rst:288
511- #, fuzzy
512538msgid ""
513539"The Boost Python Library (BPL, "
514540"https://www.boost.org/libs/python/doc/index.html) provides a way of doing"
515541" this from C++ (i.e. you can inherit from an extension class written in "
516542"C++ using the BPL)."
517543msgstr ""
518- "Boost 파이썬 라이브러리(BPL, http ://www.boost.org/libs/python/doc/index.html)는 "
544+ "Boost 파이썬 라이브러리(BPL, https ://www.boost.org/libs/python/doc/index.html)는 "
519545"C++에서 이를 수행하는 방법을 제공합니다 (즉, BPL을 사용하여 C++로 작성된 확장 클래스를 상속할 수 있습니다)."
520546
521- #~ msgid ""
522- #~ "However sometimes you have to run "
523- #~ "the embedded Python interpreter in the"
524- #~ " same thread as your rest application"
525- #~ " and you can't allow the "
526- #~ ":c:func:`PyRun_InteractiveLoop` to stop while "
527- #~ "waiting for user input. The one "
528- #~ "solution then is to call "
529- #~ ":c:func:`PyParser_ParseString` and test for "
530- #~ "``e.error`` equal to ``E_EOF``, which "
531- #~ "means the input is incomplete. Here's"
532- #~ " a sample code fragment, untested, "
533- #~ "inspired by code from Alex Farber::"
534- #~ msgstr ""
535- #~ "그러나 때로는 나머지 응용 프로그램과 같은 스레드에서 "
536- #~ "내장된 파이썬 인터프리터를 실행해야 하고, 사용자 입력을"
537- #~ " 기다리는 동안 :c:func:`PyRun_InteractiveLoop`\\를 중지할"
538- #~ " 수 없습니다. 한 가지 해결책은 "
539- #~ ":c:func:`PyParser_ParseString`\\을 호출하고 ``e.error``\\가 "
540- #~ "``E_EOF``\\와 같은지를 검사하는 것인데, 이는 입력이 "
541- #~ "불완전하다는 것을 의미합니다. 다음은 Alex Farber의 "
542- #~ "코드에서 영감을 얻은 테스트 되지 않은 샘플 코드"
543- #~ " 조각입니다::"
544-
545- #~ msgid ""
546- #~ "Another solution is trying to compile"
547- #~ " the received string with "
548- #~ ":c:func:`Py_CompileString`. If it compiles "
549- #~ "without errors, try to execute the "
550- #~ "returned code object by calling "
551- #~ ":c:func:`PyEval_EvalCode`. Otherwise save the "
552- #~ "input for later. If the compilation "
553- #~ "fails, find out if it's an error"
554- #~ " or just more input is required "
555- #~ "- by extracting the message string "
556- #~ "from the exception tuple and comparing"
557- #~ " it to the string \"unexpected EOF"
558- #~ " while parsing\". Here is a complete"
559- #~ " example using the GNU readline "
560- #~ "library (you may want to ignore "
561- #~ "**SIGINT** while calling readline())::"
562- #~ msgstr ""
563- #~ "다른 해결책은 수신된 문자열을 "
564- #~ ":c:func:`Py_CompileString`\\으로 컴파일하려고 하는 것입니다. "
565- #~ "에러 없이 컴파일되면, :c:func:`PyEval_EvalCode`\\를 호출하여"
566- #~ " 반환된 코드 객체를 실행해 보십시오. 그렇지 않으면"
567- #~ " 나중을 위해 입력을 저장하십시오. 컴파일이 실패하면, "
568- #~ "예외 튜플에서 메시지 문자열을 추출하고 이를 "
569- #~ "\"unexpected EOF while parsing\" 문자열과 "
570- #~ "비교하여 에러인지 단지 더 많은 입력이 필요한지를 "
571- #~ "확인하십시오. 다음은 GNU readline 라이브러리를 사용하는 "
572- #~ "완전한 예제입니다 (readline()을 호출하는 동안 "
573- #~ "**SIGINT**\\를 무시하고자 할 수 있습니다)::"
574-
0 commit comments