Running code from source that includes extension modules

Discussion in 'Python' started by Michael Schwarz, Oct 2, 2013.

  1. 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
     
    Michael Schwarz, Oct 2, 2013
    #1
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anand
    Replies:
    3
    Views:
    1,132
    Tim Daneliuk
    Nov 8, 2003
  2. Author Tarun Tyagi
    Replies:
    0
    Views:
    942
    Author Tarun Tyagi
    Dec 29, 2004
  3. Replies:
    32
    Views:
    1,923
    dgutson
    Sep 15, 2012
  4. Jens-Oliver Murer
    Replies:
    1
    Views:
    608
    Jens-Oliver Murer
    Oct 17, 2008
  5. Bill Kelly
    Replies:
    3
    Views:
    183
    George Ogata
    Mar 20, 2006
  6. Alpha Blue
    Replies:
    0
    Views:
    216
    Alpha Blue
    Jan 30, 2010
  7. Jenny
    Replies:
    3
    Views:
    447
    Dag Sunde
    Dec 17, 2004
  8. Satabdi Mukherjee
    Replies:
    1
    Views:
    677
    Terry Jan Reedy
    Apr 4, 2013
Loading...