Created
December 22, 2016 23:14
-
-
Save theodox/b2b6f6d99285aa0ccab4e63453df4d94 to your computer and use it in GitHub Desktop.
takes some of the typing out of compiling a Python27 exe using Cython. Expects that you've got https://www.microsoft.com/en-us/download/details.aspx?id=44266 installed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import subprocess | |
PYHOME = os.environ.get("PY27", "C:\\ul\\tools\\python\\python27\\") | |
PYLIB = PYHOME + "libs" | |
PYINC = PYHOME + "include" | |
subprocess.call(("cython", sys.argv[-1], "--embed" )) | |
scriptfile = sys.argv[-1].replace(".pyx", ".py").replace(".py", ".c") | |
args = "cl.exe", "/I", PYINC, scriptfile | |
os.environ["LINK"] = "/LIBPATH:"+PYLIB | |
print args | |
subprocess.call(args) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment