python release dll, can't capture error output

Dibatalkan Disiarkan Oct 3, 2012 Dibayar semasa penghantaran
Dibatalkan Dibayar semasa penghantaran

I have a C++ program that captures and displays the syntax or runtime error information when a python script is run. It works when compiled with the debug python dll, [login to view URL], but not with the realease dll. Another programmer working on the project tod me this has something to do with the dll itself.

## Deliverables

here is some of the code showing how input is captured:

//set up error and print catching, do this first so that any following error will be caught

PyRun_SimpleString("import ograb72984");

PyRun_SimpleString("import sys");

PyRun_SimpleString("class a7198429:\n\tdef write(self,s):\n\t\[login to view URL](s)\n");//output-grabber class, funny name to prevent ambiguity with user-defined classes

PyRun_SimpleString("sys.stderr=a7198429()\nsys.stdout=a7198429()"); //\n");

//////////////////////py grabber

include "pyinc.h"

#include "AutoCore.h"

#include "PyMethsGrabber.h"

extern AutoCore Auto;

//used to capture python stderr and stdout streams

//equivilent to [login to view URL], [login to view URL] not used becasue would require importing tp module in globab interpreter, now only small module needs importing, see AutoCore::AutoCore()

static PyObject* ograb(PyObject *self, PyObject *args)

{

char *s;

if(!PyArg_ParseTuple(args, "s", &s))

return NULL;

[login to view URL](s);

Py_INCREF(Py_None);

return Py_None;

}

static PyMethodDef ograbMeths[] =

{

{"ograb", ograb, METH_VARARGS, NULL},

};

void InitGrabberMeths()

{

Py_InitModule("ograb72984", ograbMeths);

}

Pengaturcaraan C Python Kejuruteraan Perisian

ID Projek: #2782104

Tentang projek

2 cadangan Projek jarak jauh Aktif Oct 21, 2012

2 pekerja bebas membida secara purata $90 untuk pekerjaan ini

ffmpegvw

See private message.

$100.3 USD dalam 5 hari
(43 Ulasan)
6.3
qgrabber

See private message.

$80 USD dalam 5 hari
(50 Ulasan)
5.3