By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,846 Members | 1,862 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,846 IT Pros & Developers. It's quick & easy.

Problem with byte-compiled code

P: n/a
eXt
Hi, I have built some modules in C++to extend python. At first
everything worked but then I began splitting my python code into
several modules. The application begins in main.py and then imports my
other modules.

The first time I run the application it works, but when python imports
the byte compiled module all I get is a blank window. Moving back all
the code into the same source file works.

I have found that removing a call to a C++ function solves the problem.
However that function is needed and I found that if I print anything
inside that function it works. It isn't time related since I tried to
sleep instead but that didn't work either.

I'm not sure if this is the correct list but I hope someone can help me
a bit.

The C++ function:

TaskScheduler& createTaskScheduler(int threadCnt, const char* logfile){
//print("createTaskScheduler");
TaskScheduler::initialize(threadCnt,logfile);
return TaskScheduler::singleton();
}

Boost exporting:

def("createTaskScheduler", createTaskScheduler,
return_value_policy<reference_existing_object>());

Python code:

ts = Core.createTaskScheduler(1,'')

Jan 11 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.