Running code from source that includes extension modules

  • Thread starter Michael Schwarz
  • Start date
M

Michael Schwarz

Hi

I've just started looking into distutils because I need to write an
extension module in C (for performance reasons) and distutils seems to be
the most straight-forward way.

I've had success building a C file into a Python extension module using
"python setup.py build" but I am wondering what the recommended way for
using that module during development is. While writing Python code I'm used
to just run the code from the source directory. But the built extension
module's .so of course does not just end up on sys.path magically.

So how do I run my code so it will find the built extension module? Do I
pass the output directory on the command line manually or is there some
other solution? I would like to still be able to run the code from the
source directory as I'm using PyCharm to edit and debug the code.

Many thanks!

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top