8
8
msgstr ""
9
9
"Project-Id-Version : Python 3.13\n "
10
10
"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 "
12
12
"PO-Revision-Date : 2018-05-23 14:09+0000\n "
13
13
"Last-Translator : Adrian Liaw <adrianliaw2000@gmail.com>\n "
14
14
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
@@ -420,62 +420,64 @@ msgid ""
420
420
" return PyLong_FromLong(numargs);\n"
421
421
"}\n"
422
422
"\n"
423
- "static PyMethodDef EmbMethods [] = {\n"
423
+ "static PyMethodDef emb_module_methods [] = {\n"
424
424
" {\" numargs\" , emb_numargs, METH_VARARGS,\n"
425
425
" \" Return the number of arguments received by the process.\" },\n"
426
426
" {NULL, NULL, 0, NULL}\n"
427
427
"};\n"
428
428
"\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"
432
434
"};\n"
433
435
"\n"
434
436
"static PyObject*\n"
435
437
"PyInit_emb(void)\n"
436
438
"{\n"
437
- " return PyModule_Create(&EmbModule );\n"
439
+ " return PyModuleDef_Init(&emb_module );\n"
438
440
"}"
439
441
msgstr ""
440
442
441
- #: ../../extending/embedding.rst:265
443
+ #: ../../extending/embedding.rst:267
442
444
msgid ""
443
445
"Insert the above code just above the :c:func:`main` function. Also, insert "
444
446
"the following two statements before the call to :c:func:`Py_Initialize`::"
445
447
msgstr ""
446
448
447
- #: ../../extending/embedding.rst:268
449
+ #: ../../extending/embedding.rst:270
448
450
msgid ""
449
451
"numargs = argc;\n"
450
452
"PyImport_AppendInittab(\" emb\" , &PyInit_emb);"
451
453
msgstr ""
452
454
"numargs = argc;\n"
453
455
"PyImport_AppendInittab(\" emb\" , &PyInit_emb);"
454
456
455
- #: ../../extending/embedding.rst:271
457
+ #: ../../extending/embedding.rst:273
456
458
msgid ""
457
459
"These two lines initialize the ``numargs`` variable, and make the :func:`!"
458
460
"emb.numargs` function accessible to the embedded Python interpreter. With "
459
461
"these extensions, the Python script can do things like"
460
462
msgstr ""
461
463
462
- #: ../../extending/embedding.rst:275
464
+ #: ../../extending/embedding.rst:277
463
465
msgid ""
464
466
"import emb\n"
465
467
"print(\" Number of arguments\" , emb.numargs())"
466
468
msgstr ""
467
469
468
- #: ../../extending/embedding.rst:280
470
+ #: ../../extending/embedding.rst:282
469
471
msgid ""
470
472
"In a real application, the methods will expose an API of the application to "
471
473
"Python."
472
474
msgstr ""
473
475
474
- #: ../../extending/embedding.rst:290
476
+ #: ../../extending/embedding.rst:292
475
477
msgid "Embedding Python in C++"
476
478
msgstr ""
477
479
478
- #: ../../extending/embedding.rst:292
480
+ #: ../../extending/embedding.rst:294
479
481
msgid ""
480
482
"It is also possible to embed Python in a C++ program; precisely how this is "
481
483
"done will depend on the details of the C++ system used; in general you will "
@@ -484,19 +486,19 @@ msgid ""
484
486
"+."
485
487
msgstr ""
486
488
487
- #: ../../extending/embedding.rst:301
489
+ #: ../../extending/embedding.rst:303
488
490
msgid "Compiling and Linking under Unix-like systems"
489
491
msgstr ""
490
492
491
- #: ../../extending/embedding.rst:303
493
+ #: ../../extending/embedding.rst:305
492
494
msgid ""
493
495
"It is not necessarily trivial to find the right flags to pass to your "
494
496
"compiler (and linker) in order to embed the Python interpreter into your "
495
497
"application, particularly because Python needs to load library modules "
496
498
"implemented as C dynamic extensions (:file:`.so` files) linked against it."
497
499
msgstr ""
498
500
499
- #: ../../extending/embedding.rst:309
501
+ #: ../../extending/embedding.rst:311
500
502
msgid ""
501
503
"To find out the required compiler and linker flags, you can execute the :"
502
504
"file:`python{X.Y}-config` script which is generated as part of the "
@@ -505,13 +507,13 @@ msgid ""
505
507
"directly useful to you:"
506
508
msgstr ""
507
509
508
- #: ../../extending/embedding.rst:315
510
+ #: ../../extending/embedding.rst:317
509
511
msgid ""
510
512
"``pythonX.Y-config --cflags`` will give you the recommended flags when "
511
513
"compiling:"
512
514
msgstr ""
513
515
514
- #: ../../extending/embedding.rst:318
516
+ #: ../../extending/embedding.rst:320
515
517
msgid ""
516
518
"$ /opt/bin/python3.11-config --cflags\n"
517
519
"-I/opt/include/python3.11 -I/opt/include/python3.11 -Wsign-compare -DNDEBUG "
@@ -521,13 +523,13 @@ msgstr ""
521
523
"-I/opt/include/python3.11 -I/opt/include/python3.11 -Wsign-compare -DNDEBUG "
522
524
"-g -fwrapv -O3 -Wall"
523
525
524
- #: ../../extending/embedding.rst:323
526
+ #: ../../extending/embedding.rst:325
525
527
msgid ""
526
528
"``pythonX.Y-config --ldflags --embed`` will give you the recommended flags "
527
529
"when linking:"
528
530
msgstr ""
529
531
530
- #: ../../extending/embedding.rst:326
532
+ #: ../../extending/embedding.rst:328
531
533
msgid ""
532
534
"$ /opt/bin/python3.11-config --ldflags --embed\n"
533
535
"-L/opt/lib/python3.11/config-3.11-x86_64-linux-gnu -L/opt/lib -lpython3.11 -"
@@ -537,15 +539,15 @@ msgstr ""
537
539
"-L/opt/lib/python3.11/config-3.11-x86_64-linux-gnu -L/opt/lib -lpython3.11 -"
538
540
"lpthread -ldl -lutil -lm"
539
541
540
- #: ../../extending/embedding.rst:332
542
+ #: ../../extending/embedding.rst:334
541
543
msgid ""
542
544
"To avoid confusion between several Python installations (and especially "
543
545
"between the system Python and your own compiled Python), it is recommended "
544
546
"that you use the absolute path to :file:`python{X.Y}-config`, as in the "
545
547
"above example."
546
548
msgstr ""
547
549
548
- #: ../../extending/embedding.rst:337
550
+ #: ../../extending/embedding.rst:339
549
551
msgid ""
550
552
"If this procedure doesn't work for you (it is not guaranteed to work for all "
551
553
"Unix-like platforms; however, we welcome :ref:`bug reports <reporting-"
@@ -557,7 +559,7 @@ msgid ""
557
559
"For example:"
558
560
msgstr ""
559
561
560
- #: ../../extending/embedding.rst:346
562
+ #: ../../extending/embedding.rst:348
561
563
msgid ""
562
564
">>> import sysconfig\n"
563
565
">>> sysconfig.get_config_var('LIBS')\n"
0 commit comments