Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #55352

Running code from source that includes extension modules

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!newsfeed0.kamp.net!newsfeed.kamp.net!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.83.MISMATCH!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <michi.schwarz@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'output': 0.05; 'debug': 0.07; 'distutils': 0.07; 'subject:code': 0.07; 'setup.py': 0.09; 'subject:modules': 0.09; 'python': 0.11; '"python': 0.16; "module's": 0.16; 'module?': 0.16; 'sys.path': 0.16; 'code.': 0.18; 'module': 0.19; 'seems': 0.21; 'command': 0.22; 'directory.': 0.24; "i've": 0.25; 'source': 0.25; 'extension': 0.26; 'pass': 0.26; '(for': 0.26; 'michael': 0.29; 'wondering': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'subject:that': 0.31; 'file': 0.32; 'thanks!': 0.32; 'run': 0.32; 'subject:from': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'building': 0.35; 'there': 0.35; 'performance': 0.37; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'is.': 0.60; 'manually': 0.60; 'most': 0.60; 'success': 0.61; 'course': 0.61; 'subject:source': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=FT5Tnb7jBRqq1Tc6Tn+NrNDBJyUssbP7PeAsDDfAOuQ=; b=IKrDHlc5RSQLHLictbcRtKRZ31Ms8aOPK0iJP3jqs/dDpXvR5kZAzMVP/XiEvU/X/8 lgQpp7IuKda9iU19CIN6o49eBJ4jiCaZyz/txfvpbgIv1VnJbC7U0YoWexRKtb4OxAT7 +LN7pfyS9SP7mV1W9qOj3eSgkHPSveTKmV3W2FQXx49nyuYW+XslALXhPRhHOJQzsiZ+ q4Hkv06fxB40HcuFp/QFCu+3OSc13GuHDbvc2zzXItjuvd62PhKpZiG/69LrvcLMCV+t P2cr0jqBib87maBSQTXr1n6WNA6eatjWMah/vVZjkvSnNkxrCGuWb0eHkmFVq9kzBPqa grqg==
MIME-Version 1.0
X-Received by 10.152.87.143 with SMTP id ay15mr2512494lab.2.1380728301932; Wed, 02 Oct 2013 08:38:21 -0700 (PDT)
Date Wed, 2 Oct 2013 17:38:21 +0200
Subject Running code from source that includes extension modules
From Michael Schwarz <michi.schwarz@gmail.com>
To python-list@python.org
Content-Type multipart/alternative; boundary=001a11c2409cf7d87004e7c3db31
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.638.1380728304.18130.python-list@python.org> (permalink)
Lines 47
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1380728304 news.xs4all.nl 15985 [2001:888:2000:d::a6]:56817
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:55352

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Running code from source that includes extension modules Michael Schwarz <michi.schwarz@gmail.com> - 2013-10-02 17:38 +0200

csiph-web