On 03/04/2010 01:59 PM, Neal Becker wrote:
OK. I had assumed, since it returned an object, that I could call a
function and get back the python result. I didn't use eval, because eval is
restricted to 1 expression, and so couldn't do something like:
'''
sys.path.append('./')
import module
modu
Stefan Seefeld wrote:
> Neal,
>
> I should have read your mail more carefully before replying. Sorry for
> that.
>
>
> On 03/04/2010 01:35 PM, Neal Becker wrote:
>> Stefan Seefeld wrote:
>>
>>
>>> On 03/04/2010 11:59 AM, Neal Becker wrote:
>>>
int main () {
Py_Initialize
Neal,
I should have read your mail more carefully before replying. Sorry for that.
On 03/04/2010 01:35 PM, Neal Becker wrote:
Stefan Seefeld wrote:
On 03/04/2010 11:59 AM, Neal Becker wrote:
int main () {
Py_Initialize();
object main_module = import("__main__");
objec
Stefan Seefeld wrote:
> On 03/04/2010 11:59 AM, Neal Becker wrote:
>> int main () {
>>Py_Initialize();
>>
>>object main_module = import("__main__");
>>object main_namespace = main_module.attr("__dict__");
>>
>>try {
>> object result = exec ("import sys\n"
>> "sys.path.append('
On 03/04/2010 11:59 AM, Neal Becker wrote:
int main () {
Py_Initialize();
object main_module = import("__main__");
object main_namespace = main_module.attr("__dict__");
try {
object result = exec ("import sys\n"
"sys.path.append('./')\n"
int main () {
Py_Initialize();
object main_module = import("__main__");
object main_namespace = main_module.attr("__dict__");
try {
object result = exec ("import sys\n"
"sys.path.append('./')\n"
"import test_embed\n"
Great : implementing __hash__ *and* operator==() did the trick !
My implementation uses this
int hello::__hash__() const
{
//Using Duff's device version of sdbm hash func
return dbm_hash(country.c_str(), country.length());
}
bool hello::operator == (const hello &h) const {
return __ha