Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Automatic Distutils generator

Thread Tools

Automatic Distutils generator

Posts: n/a
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

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:

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

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

print 'Files convert: \n'
print fileList


Who can help me fix it?

Best Regards

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Python packaging usabilty (distutils) - automatic downloadingrequired packages XLiIV Python 1 02-25-2012 03:29 PM
distutils, No module named numpy.distutils.fcompiler.conv_template Luis Alberto Zarrabeitia Gomez Python 0 03-30-2009 03:56 PM
can distutils windows installer invoke another distutils windows installer Python 1 05-11-2006 10:07 PM
UART with fractional baudrate generator ? Or fractional baudrate generator alone Martin Maurer VHDL 3 04-19-2006 01:26 PM
generator function within a generator function doesn't execute? TheDustbustr Python 1 07-25-2003 10:45 AM