Discussion:
[python-win32] Building my own C extension
Ken Brooks
2015-11-04 23:22:46 UTC
Permalink
I have joined this list because I need to learn how to rebuild my antiquated Python extension properly for Windows. I need to build for Python 2.7, which is old and relies upon old compilers. I downloaded the suggested compiler:

http://download.microsoft.com/download/A/5/4/A54BADB6-9C3F-478D-8657-93B3FC9FE62D/vcsetup.exe

I downloaded the thing that is supposed to correctly glue it to Python:

https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi

But I can't see where to go from there.

In my old world I never actually learned how to use distutils or setuptools; I was just building my extension with my VC and then shoving it into site-packages. As I read the documentation for distutils and setuptools, I am SO LOST! I see much about how to install someone else's package, but little about how to create and script my own package for building a Python extension written in C. Please, can someone point me to a good sample extension package that I can copy from? A "hello world" or something?

Apart from that, can someone please point me to the documentation for the current "right" way of building things, as an extension developer?

Thanks in advance,

Ken
Zachary Turner via python-win32
2015-11-05 01:33:39 UTC
Permalink
Two questions:

1) Are you embedding this extension in your own application or do you only
need to be able to load it into a stock Python distribution?
2) Is Python 3.5 out of the question?
Post by Ken Brooks
I have joined this list because I need to learn how to rebuild my
antiquated Python extension properly for Windows. I need to build for
Python 2.7, which is old and relies upon old compilers. I downloaded the
http://download.microsoft.com/download/A/5/4/A54BADB6-9C3F-478D-8657-93B3FC9FE62D/vcsetup.exe
https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi
But I can't see where to go from there.
In my old world I never actually learned how to use distutils or
setuptools; I was just building my extension with my VC and then shoving it
into site-packages. As I read the documentation for distutils and
setuptools, I am SO LOST! I see much about how to install someone else's
package, but little about how to create and script my own package for
building a Python extension written in C. Please, can someone point me to a
good sample extension package that I can copy from? A "hello world" or
something?
Apart from that, can someone please point me to the documentation for the
current "right" way of building things, as an extension developer?
Thanks in advance,
Ken
_______________________________________________
python-win32 mailing list
https://mail.python.org/mailman/listinfo/python-win32
Loading...