File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -407,6 +407,12 @@ msgid ""
407407" c = c + b\n"
408408" return c"
409409msgstr ""
410+ "def multiply(a,b):\n"
411+ " print(\" Will compute\" , a, \" times\" , b)\n"
412+ " c = 0\n"
413+ " for i in range(0, a):\n"
414+ " c = c + b\n"
415+ " return c"
410416
411417#: ../../extending/embedding.rst:180
412418msgid "then the result should be:"
@@ -438,6 +444,10 @@ msgid ""
438444"/* Error checking of pName left out */\n"
439445"pModule = PyImport_Import(pName);"
440446msgstr ""
447+ "Py_Initialize();\n"
448+ "pName = PyUnicode_DecodeFSDefault(argv[1]);\n"
449+ "/* Error checking of pName left out */\n"
450+ "pModule = PyImport_Import(pName);"
441451
442452#: ../../extending/embedding.rst:197
443453msgid ""
@@ -460,6 +470,13 @@ msgid ""
460470"}\n"
461471"Py_XDECREF(pFunc);"
462472msgstr ""
473+ "pFunc = PyObject_GetAttrString(pModule, argv[2]);\n"
474+ "/* pFunc is a new reference */\n"
475+ "\n"
476+ "if (pFunc && PyCallable_Check(pFunc)) {\n"
477+ " ...\n"
478+ "}\n"
479+ "Py_XDECREF(pFunc);"
463480
464481#: ../../extending/embedding.rst:210
465482msgid ""
You can’t perform that action at this time.
0 commit comments