FAQ
Hi Folks


I am trying run Distutils setup inside a script.

The Docs dont tell me much and I cant find any examples.

This script will generate shared libraries recursive to all files in a
dir.


-----------------------------
import os
import sys
from distutils.core import setup as d
from distutils.extension import Extension
from Cython.Distutils import build_ext

fileList = []
rootdir = sys.argv[1]
fileType = '.pyx'

for root, subFolders, files in os.walk(rootdir):
for file in files:
if file[-4:] == fileType:
fileList.append(os.path.join(root,file))

# But Here I want automatic Distutils generator
# I want replace manual entry like this:
# python setup.py build_ext --inplace

d.setup(name = str(file) + '_Cython',
ext_modules=[
Extension(file[:-4], [file])
],
cmdclass = {'build_ext': build_ext})
d.run_setup()



print 'Files convert: \n'
print fileList

----------------------------

Who can help me fix it?


Best Regards

Mario

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedNov 25, '10 at 6:53p
activeNov 25, '10 at 6:53p
posts1
users1
websitepython.org

1 user in discussion

Macm: 1 post

People

Translate

site design / logo © 2022 Grokbase