Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
acc68cc2
Kaydet (Commit)
acc68cc2
authored
Ara 09, 2008
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#4592: fix embedding example with new C API changes.
üst
a872787f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
embedding.rst
Doc/extending/embedding.rst
+8
-2
extending.rst
Doc/extending/extending.rst
+1
-1
No files found.
Doc/extending/embedding.rst
Dosyayı görüntüle @
acc68cc2
...
...
@@ -223,11 +223,17 @@ Python extension. For example::
NULL, NULL, NULL, NULL
};
static PyObject*
PyInit_emb(void)
{
return PyModule_Create(&EmbModule);
}
Insert the above code just above the :cfunc:`main` function. Also, insert the
following two statements
directly after
:cfunc:`Py_Initialize`::
following two statements
before the call to
:cfunc:`Py_Initialize`::
numargs = argc;
Py
Module_Create(&EmbModule
);
Py
Import_AppendInittab("emb", &PyInit_emb
);
These two lines initialize the ``numargs`` variable, and make the
:func:`emb.numargs` function accessible to the embedded Python interpreter.
...
...
Doc/extending/extending.rst
Dosyayı görüntüle @
acc68cc2
...
...
@@ -342,7 +342,7 @@ satisfactorily. The init function must return the module object to its caller,
so that it then gets inserted into ``sys.modules``.
When embedding Python, the :cfunc:`PyInit_spam` function is not called
automatically unless there's an entry in the :cdata:`
_
PyImport_Inittab` table.
automatically unless there's an entry in the :cdata:`PyImport_Inittab` table.
To add the module to the initialization table, use :cfunc:`PyImport_AppendInittab`,
optionally followed by an import of the module::
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment