You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
(3) |
Aug
(7) |
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(12) |
2009 |
Jan
(2) |
Feb
(7) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
(2) |
Apr
(16) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(5) |
Oct
(5) |
Nov
(1) |
Dec
(2) |
2011 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
(5) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(2) |
Dec
|
2015 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(2) |
Sep
(3) |
Oct
|
Nov
(4) |
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
(8) |
May
(2) |
Jun
(2) |
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(9) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2021 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(11) |
From: Barry S. <ba...@ba...> - 2008-07-06 09:50:43
|
On May 18, 2008, at 16:57, Sven Alisch wrote: > Hi members! > > I am new to this list, so sorry for my bad english. I hope you > understand me. > > First of all: Thanks for your great and well documented project. It > is very > simple to start programming a wrapper. I tried a little bit and it > works. > > Now I want to do following. I want to program a callback function. > This means > I want to give my C++-Methods a Python-Function (like a c function > pointer). > Then I want to call this Python-Function like a callback-function > in C. But > how to do this? Could anybody be so sind to give me a hint? Sorry for the long time in replying... Do you want to call python code from C++? Create a Py::Callable object and use its apply() method to call the python code. The pysvn project uses pycxx and uses a lot of its features. Its project page is http://pysvn.tigris.org. It may have examples that an useful to you. Barry |
From: Sven A. <sv...@gm...> - 2008-05-18 13:57:50
|
Hi members! I am new to this list, so sorry for my bad english. I hope you understand me. First of all: Thanks for your great and well documented project. It is very simple to start programming a wrapper. I tried a little bit and it works. Now I want to do following. I want to program a callback function. This means I want to give my C++-Methods a Python-Function (like a c function pointer). Then I want to call this Python-Function like a callback-function in C. But how to do this? Could anybody be so sind to give me a hint? Thanks a lot, Sincerly, Sven |
From: Barry S. <ba...@ba...> - 2007-10-19 16:12:27
|
On Oct 18, 2007, at 04:40, Tim Docker wrote: > I've just been taking a look at pyCxx, and it's looks quite nice. > > I notice that in Objects.hxx, there's lot's of code snippets that > look like: > > if (PyErr_Occurred()) throw Exception(); > > Would it be better to call a function that interrogates the > exeception status, and throws an exception of the appropriate > derived type? That way you could catch more specifically in the C++ > code. > Having re-read the code that would be better. Would you like to submit a patch to do this? > > Also, is there a reason why Exception doesn't derive from > std::exception? No reason, the code is older then std::exception and I guess it should be updated so long as there is no problem introduced by doing this. Barry |
From: Tim D. <ti...@ma...> - 2007-10-18 03:40:16
|
I've just been taking a look at pyCxx, and it's looks quite nice. =20 I notice that in Objects.hxx, there's lot's of code snippets that look like: =20 if (PyErr_Occurred()) throw Exception(); =20 Would it be better to call a function that interrogates the exeception status, and throws an exception of the appropriate derived type? That way you could catch more specifically in the C++ code. =20 Also, is there a reason why Exception doesn't derive from std::exception? =20 thanks, =20 Tim |
From: Barry S. <ba...@ba...> - 2007-03-17 10:13:08
|
On Mar 15, 2007, at 13:41, Gregor Mirai wrote: > Hello, There is a PyCXX mailing list that we can use for this. I've CC'ed to get this useful info onto the list. > > I have traced the problem down to the GCC compiler. > > For instance using more than one shared object file from python > works ok when > they are compiled on Solaris machine. > > The cause of the problem (when compiling with GCC) are multiple > exception > typeinfos that have different addresses which does not match well > when python > tries to catch exceptions. In effect python doesn't catch them and the > program terminates. > > It seems this is a well known bug, that will be fixed in upcoming > version 4.2. > of GCC compiler. > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 That's nasty. > > I am not sure if there is any workaround for this issue. The > intermediate > solution would be to catch all exceptions in python extension > libraries and > return some sort of exception info to the caller. THe code does catch all exceptions and return to python. I guess that the compiler bug is preventing C++ exceptions from working. And that means that the translation from C++ to Python exceptions is broken. Barry |
From: Barry S. <ba...@ba...> - 2006-12-08 23:07:16
|
On Dec 8, 2006, at 17:07, carlos choy wrote: > I looked at the Demo folder and found usage of the Callable > interface in > rangetext.cxx. > In version 5.36, rangetest.cxx has the following lines (starting at > line > 29): > > ******************************************* > RangeSequence r2(1, 10, 2); > if(r2[1] != Py::Int(3)) > return "RangeSequence check failed. "; > > debug_check_ref_queue(); > > // calling an extension object method using getattr > Py::Callable w(r2.getAttr("amethod")); > Py::Tuple args(1); > Py::Int j(3); > args[0]=j; > Py::List answer(w.apply(args)); > if(answer[0] != r2) > return ("Extension object test failed (1)"); > > if(answer[1] != args[0]) > return ("Extension object test failed (2)"); > ******************************************* > > I see that RangeSequence is a class extending a python sequence. > However, I > don't see how "amethod" could be an attribute of it. "amethod" is > a method > of the range class, but this class seems to have nothing to do with > RangeSequence. How is this method an attribute of the extended class? RangeSequence is Py::Object that points to an instance of range. See line 112 of range.hxx. > Next, I see that 'w' is a Callable object, but I do not see how it > can have > an 'apply' method. Is the 'apply' method putting the arguments in > 'args' > into the method "amethod"? It works the same way that apply builtin works in python. Call the function that w contains passing it args and store the returned value in answer. > > Lastly, I don't see at all how the Callable object is calling back > into a > python script. The apply() functions calls into python. > > Can you please give me some explanations? Sorry if this all seems > rather > elementary, but I am trying my best to understand it. No problem. Barry |
From: carlos c. <hap...@ho...> - 2006-12-08 17:07:24
|
Thanks for the prompt reply. I looked at the Demo folder and found usage of the Callable interface in rangetext.cxx. In version 5.36, rangetest.cxx has the following lines (starting at line 29): ******************************************* RangeSequence r2(1, 10, 2); if(r2[1] != Py::Int(3)) return "RangeSequence check failed. "; debug_check_ref_queue(); // calling an extension object method using getattr Py::Callable w(r2.getAttr("amethod")); Py::Tuple args(1); Py::Int j(3); args[0]=j; Py::List answer(w.apply(args)); if(answer[0] != r2) return ("Extension object test failed (1)"); if(answer[1] != args[0]) return ("Extension object test failed (2)"); ******************************************* I see that RangeSequence is a class extending a python sequence. However, I don't see how "amethod" could be an attribute of it. "amethod" is a method of the range class, but this class seems to have nothing to do with RangeSequence. How is this method an attribute of the extended class? Next, I see that 'w' is a Callable object, but I do not see how it can have an 'apply' method. Is the 'apply' method putting the arguments in 'args' into the method "amethod"? Lastly, I don't see at all how the Callable object is calling back into a python script. Can you please give me some explanations? Sorry if this all seems rather elementary, but I am trying my best to understand it. >From: Barry Scott <ba...@ba...> >Reply-To: Discuss PyCXX use and improvement ><cxx...@li...> >To: Discuss PyCXX use and improvement <cxx...@li...> >Subject: Re: Embedding Python >Date: Sun, 3 Dec 2006 19:33:04 +0000 > > >On Dec 1, 2006, at 18:54, carlos choy wrote: > I am thinking of using PyCXX principally for embedding Python. > >This works. You will need to create a module using PyCXX if you >wish the python code to be able to call you back. > >If you use threads there is extra work in the init and in the module >you will need to worry about. > > Here is some basic code for embedding that I intend to use: **************************************************************** #include <Python.h> int main(int argc, char *argv[]) { PyObject *pName, *pModule, *pDict, *pFunc, *pValue; > >Use appropriate Py:: objects. > if (argc < 3) { printf("Usage: exe_name python_source function_name\n"); return 1; } > > Give python an argc and argv before calling init. > // Initialize the Python Interpreter Py_Initialize(); // Build the name object pName = PyString_FromString(argv[1]); > > Py::String name( argv[1] ); > // Load the module object pModule = PyImport_Import(pName); > > Py::Module module( PyImport_Import( name ) ); > // pDict is a borrowed reference pDict = PyModule_GetDict(pModule); > >Py::Dict dict( module.getDict() ); > // pFunc is also a borrowed reference pFunc = PyDict_GetItemString(pDict, argv[2]); > > Py::Callable func( dict[ Py::String( argv[2] ) ] ); > if (PyCallable_Check(pFunc)) { PyObject_CallObject(pFunc, NULL); } else { PyErr_Print(); } > >No need to do the if an exception will be raise if an objects type >does not match. > > // no args > Py::Tuple args( 0 ); > > func.apply( args ); > // Clean up Py_DECREF(pModule); Py_DECREF(pName); > > No need to call dec. > But you will need to make sure that the Py:: onjects go out of scope >so that > they are deleted before calling finalize. > // Finish the Python Interpreter Py_Finalize(); return 0; } ********************** I assume the above will work. Is there a more PyCXX way of doing this? > >See comments in line above. > Lastly, I need to have callbacks into C++ code from Python. The Callable interface is documented, but samples. Can someone please post examples of how to use it? _________________________________________________________________ > >Define a module and add functions and classes. Look at the example >that comes with PyCXX in the Demo folder. For example look at >range.hxx and .cxx. > >If you want a full scale example look at the source of the Python SVN >extension, pysvn >at http://pysvn.tigris.org - download a source kit add you will see >examples of calling C++ from >python and calling python from C++. > >Barry > > > >------------------------------------------------------------------------- >Take Surveys. Earn Cash. Influence the Future of IT >Join SourceForge.net's Techsay panel and you'll get the chance to share >your >opinions on IT & business topics through brief surveys - and earn cash >http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >_______________________________________________ >CXX-Users mailing list >CXX...@li... >https://lists.sourceforge.net/lists/listinfo/cxx-users _________________________________________________________________ Enter the "Telus Mobility Xbox a Day" contest for your chance to WIN! Telus Mobility is giving away an Microsoft Xbox® 360 every day from November 20 to December 31, 2006! Just download Windows Live (MSN) Messenger to your IM-capable TELUS mobile phone, and you could be a winner! http://www.telusmobility.com/msnxbox/ > >_________________________________________________________________ >Be one of the first to try Windows Live Mail. >http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d _________________________________________________________________ Not only does WindowsOff to school, going on a trip, or moving? Windows Live (MSN) Messenger lets you stay in touch with friends and family wherever you go. Click here to find out how to sign up! Live OneCare provide all-in-one PC care to keep your computer protected and well-maintained, but it also makes creating backup files a breeze. Try it today! http://www.telusmobility.com/msnxbox/ |
From: Barry S. <ba...@ba...> - 2006-12-03 19:33:43
|
On Dec 1, 2006, at 18:54, carlos choy wrote: > I am thinking of using PyCXX principally for embedding Python. This works. You will need to create a module using PyCXX if you wish the python code to be able to call you back. If you use threads there is extra work in the init and in the module you will need to worry about. > Here is some > basic code for embedding that I intend to use: > > **************************************************************** > #include <Python.h> > > int main(int argc, char *argv[]) > { > PyObject *pName, *pModule, *pDict, *pFunc, *pValue; > Use appropriate Py:: objects. > if (argc < 3) > { > printf("Usage: exe_name python_source function_name\n"); > return 1; > } > Give python an argc and argv before calling init. > // Initialize the Python Interpreter > Py_Initialize(); > > // Build the name object > pName = PyString_FromString(argv[1]); Py::String name( argv[1] ); > > // Load the module object > pModule = PyImport_Import(pName); Py::Module module( PyImport_Import( name ) ); > // pDict is a borrowed reference > pDict = PyModule_GetDict(pModule); Py::Dict dict( module.getDict() ); > > // pFunc is also a borrowed reference > pFunc = PyDict_GetItemString(pDict, argv[2]); Py::Callable func( dict[ Py::String( argv[2] ) ] ); > > if (PyCallable_Check(pFunc)) > { > PyObject_CallObject(pFunc, NULL); > } else > { > PyErr_Print(); > } No need to do the if an exception will be raise if an objects type does not match. // no args Py::Tuple args( 0 ); func.apply( args ); > // Clean up > Py_DECREF(pModule); > Py_DECREF(pName); No need to call dec. But you will need to make sure that the Py:: onjects go out of scope so that they are deleted before calling finalize. > > // Finish the Python Interpreter > Py_Finalize(); > > return 0; > } > ********************** > > I assume the above will work. Is there a more PyCXX way of doing > this? See comments in line above. > > Lastly, I need to have callbacks into C++ code from Python. The > Callable > interface is documented, but samples. Can someone please post > examples of > how to use it? > > _________________________________________________________________ Define a module and add functions and classes. Look at the example that comes with PyCXX in the Demo folder. For example look at range.hxx and .cxx. If you want a full scale example look at the source of the Python SVN extension, pysvn at http://pysvn.tigris.org - download a source kit add you will see examples of calling C++ from python and calling python from C++. Barry |
From: carlos c. <hap...@ho...> - 2006-12-01 18:54:45
|
I am thinking of using PyCXX principally for embedding Python. Here is some basic code for embedding that I intend to use: **************************************************************** #include <Python.h> int main(int argc, char *argv[]) { PyObject *pName, *pModule, *pDict, *pFunc, *pValue; if (argc < 3) { printf("Usage: exe_name python_source function_name\n"); return 1; } // Initialize the Python Interpreter Py_Initialize(); // Build the name object pName = PyString_FromString(argv[1]); // Load the module object pModule = PyImport_Import(pName); // pDict is a borrowed reference pDict = PyModule_GetDict(pModule); // pFunc is also a borrowed reference pFunc = PyDict_GetItemString(pDict, argv[2]); if (PyCallable_Check(pFunc)) { PyObject_CallObject(pFunc, NULL); } else { PyErr_Print(); } // Clean up Py_DECREF(pModule); Py_DECREF(pName); // Finish the Python Interpreter Py_Finalize(); return 0; } ********************** I assume the above will work. Is there a more PyCXX way of doing this? Lastly, I need to have callbacks into C++ code from Python. The Callable interface is documented, but samples. Can someone please post examples of how to use it? _________________________________________________________________ Off to school, going on a trip, or moving? Windows Live (MSN) Messenger lets you stay in touch with friends and family wherever you go. Click here to find out how to sign up! http://www.live.com/?mkt=en-ca |
From: Barry S. <ba...@ba...> - 2006-11-27 21:56:41
|
This list is for discussing the use and improvement of PyCXX - the Python C++ connection. Barry |