88msgstr ""
99"Project-Id-Version : Python 3.13\n "
1010"Report-Msgid-Bugs-To : \n "
11- "POT-Creation-Date : 2025-03-07 15:49 +0000\n "
11+ "POT-Creation-Date : 2025-05-27 00:15 +0000\n "
1212"PO-Revision-Date : 2018-05-23 14:09+0000\n "
1313"Last-Translator : Adrian Liaw <adrianliaw2000@gmail.com>\n "
1414"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
@@ -420,62 +420,64 @@ msgid ""
420420" return PyLong_FromLong(numargs);\n"
421421"}\n"
422422"\n"
423- "static PyMethodDef EmbMethods [] = {\n"
423+ "static PyMethodDef emb_module_methods [] = {\n"
424424" {\" numargs\" , emb_numargs, METH_VARARGS,\n"
425425" \" Return the number of arguments received by the process.\" },\n"
426426" {NULL, NULL, 0, NULL}\n"
427427"};\n"
428428"\n"
429- "static PyModuleDef EmbModule = {\n"
430- " PyModuleDef_HEAD_INIT, \" emb\" , NULL, -1, EmbMethods,\n"
431- " NULL, NULL, NULL, NULL\n"
429+ "static struct PyModuleDef emb_module = {\n"
430+ " .m_base = PyModuleDef_HEAD_INIT,\n"
431+ " .m_name = \" emb\" ,\n"
432+ " .m_size = 0,\n"
433+ " .m_methods = emb_module_methods,\n"
432434"};\n"
433435"\n"
434436"static PyObject*\n"
435437"PyInit_emb(void)\n"
436438"{\n"
437- " return PyModule_Create(&EmbModule );\n"
439+ " return PyModuleDef_Init(&emb_module );\n"
438440"}"
439441msgstr ""
440442
441- #: ../../extending/embedding.rst:265
443+ #: ../../extending/embedding.rst:267
442444msgid ""
443445"Insert the above code just above the :c:func:`main` function. Also, insert "
444446"the following two statements before the call to :c:func:`Py_Initialize`::"
445447msgstr ""
446448
447- #: ../../extending/embedding.rst:268
449+ #: ../../extending/embedding.rst:270
448450msgid ""
449451"numargs = argc;\n"
450452"PyImport_AppendInittab(\" emb\" , &PyInit_emb);"
451453msgstr ""
452454"numargs = argc;\n"
453455"PyImport_AppendInittab(\" emb\" , &PyInit_emb);"
454456
455- #: ../../extending/embedding.rst:271
457+ #: ../../extending/embedding.rst:273
456458msgid ""
457459"These two lines initialize the ``numargs`` variable, and make the :func:`!"
458460"emb.numargs` function accessible to the embedded Python interpreter. With "
459461"these extensions, the Python script can do things like"
460462msgstr ""
461463
462- #: ../../extending/embedding.rst:275
464+ #: ../../extending/embedding.rst:277
463465msgid ""
464466"import emb\n"
465467"print(\" Number of arguments\" , emb.numargs())"
466468msgstr ""
467469
468- #: ../../extending/embedding.rst:280
470+ #: ../../extending/embedding.rst:282
469471msgid ""
470472"In a real application, the methods will expose an API of the application to "
471473"Python."
472474msgstr ""
473475
474- #: ../../extending/embedding.rst:290
476+ #: ../../extending/embedding.rst:292
475477msgid "Embedding Python in C++"
476478msgstr ""
477479
478- #: ../../extending/embedding.rst:292
480+ #: ../../extending/embedding.rst:294
479481msgid ""
480482"It is also possible to embed Python in a C++ program; precisely how this is "
481483"done will depend on the details of the C++ system used; in general you will "
@@ -484,19 +486,19 @@ msgid ""
484486"+."
485487msgstr ""
486488
487- #: ../../extending/embedding.rst:301
489+ #: ../../extending/embedding.rst:303
488490msgid "Compiling and Linking under Unix-like systems"
489491msgstr ""
490492
491- #: ../../extending/embedding.rst:303
493+ #: ../../extending/embedding.rst:305
492494msgid ""
493495"It is not necessarily trivial to find the right flags to pass to your "
494496"compiler (and linker) in order to embed the Python interpreter into your "
495497"application, particularly because Python needs to load library modules "
496498"implemented as C dynamic extensions (:file:`.so` files) linked against it."
497499msgstr ""
498500
499- #: ../../extending/embedding.rst:309
501+ #: ../../extending/embedding.rst:311
500502msgid ""
501503"To find out the required compiler and linker flags, you can execute the :"
502504"file:`python{X.Y}-config` script which is generated as part of the "
@@ -505,13 +507,13 @@ msgid ""
505507"directly useful to you:"
506508msgstr ""
507509
508- #: ../../extending/embedding.rst:315
510+ #: ../../extending/embedding.rst:317
509511msgid ""
510512"``pythonX.Y-config --cflags`` will give you the recommended flags when "
511513"compiling:"
512514msgstr ""
513515
514- #: ../../extending/embedding.rst:318
516+ #: ../../extending/embedding.rst:320
515517msgid ""
516518"$ /opt/bin/python3.11-config --cflags\n"
517519"-I/opt/include/python3.11 -I/opt/include/python3.11 -Wsign-compare -DNDEBUG "
@@ -521,13 +523,13 @@ msgstr ""
521523"-I/opt/include/python3.11 -I/opt/include/python3.11 -Wsign-compare -DNDEBUG "
522524"-g -fwrapv -O3 -Wall"
523525
524- #: ../../extending/embedding.rst:323
526+ #: ../../extending/embedding.rst:325
525527msgid ""
526528"``pythonX.Y-config --ldflags --embed`` will give you the recommended flags "
527529"when linking:"
528530msgstr ""
529531
530- #: ../../extending/embedding.rst:326
532+ #: ../../extending/embedding.rst:328
531533msgid ""
532534"$ /opt/bin/python3.11-config --ldflags --embed\n"
533535"-L/opt/lib/python3.11/config-3.11-x86_64-linux-gnu -L/opt/lib -lpython3.11 -"
@@ -537,15 +539,15 @@ msgstr ""
537539"-L/opt/lib/python3.11/config-3.11-x86_64-linux-gnu -L/opt/lib -lpython3.11 -"
538540"lpthread -ldl -lutil -lm"
539541
540- #: ../../extending/embedding.rst:332
542+ #: ../../extending/embedding.rst:334
541543msgid ""
542544"To avoid confusion between several Python installations (and especially "
543545"between the system Python and your own compiled Python), it is recommended "
544546"that you use the absolute path to :file:`python{X.Y}-config`, as in the "
545547"above example."
546548msgstr ""
547549
548- #: ../../extending/embedding.rst:337
550+ #: ../../extending/embedding.rst:339
549551msgid ""
550552"If this procedure doesn't work for you (it is not guaranteed to work for all "
551553"Unix-like platforms; however, we welcome :ref:`bug reports <reporting-"
@@ -557,7 +559,7 @@ msgid ""
557559"For example:"
558560msgstr ""
559561
560- #: ../../extending/embedding.rst:346
562+ #: ../../extending/embedding.rst:348
561563msgid ""
562564">>> import sysconfig\n"
563565">>> sysconfig.get_config_var('LIBS')\n"
0 commit comments