Python on Windows: Get Set Up to Help With Core Development
Join the DZone community and get the full member experience.Join For Free
what you’ll need
to get up and running as a developer of python on windows, you’ll need a mercurial client to download python, update and create patches. you can use a command-line tool or you can get tortoisehg, a shell gui. once you have that configured correctly, you can do a
hg clone http://hg.python.org/cpython
or use tortoise to check out the repository. this will get you the latest python 3.x version. if you want to help with a maintenance release, then you’ll want to read the documentation . the last major tool you’ll need is a compiler and the one that’s needed for the latest python is microsoft visual studio 2010. fortunately, you don’t need to purchase the whole thing. in fact, you can just get the express version of visual c++ 2010 and you’ll be good to go. note that this tool is not lightweight and ends up taking over one gigabyte of space on disc. sad, but true.
compiling python on windows 7
as you may have guessed, we’ll be doing the compiling of python on windows 7. i have windows xp too, but that os is practically dead now, so i’m not going to cover it. i doubt it’s much different anyway. regardless, according to the dev guide documentation , you need to go into the repo that you just created on your machine and go into the pcbuild folder. then find the pcbuild.sln file and run it with your new visual studio c++ application. you may see a warning from it about how the express version doesn’t support solutions, but just ignore that. once the project is loaded, go into the debug menu and select build solution . oddly enough, the official docs say to go into the build menu, not the debug menu, but my copy doesn’t have a build menu to choose from.
when i ran the build i got the following result at the end:
========== build: 20 succeeded, 8 failed, 0 up-to-date, 3 skipped ==========
looking through the log, it looks like it was unable to find the header files for sqlite3 and tcl and it had some issues with the bzip lib. it also complained that i don’t have activeperl / openssh installed. however, it still compiled python and i had a fresh python_d.exe file in my pcbuild folder that i could run. i ran it by double-clicking it, but you can also run it from within visual studio using f5 or by going to the debug menu and clicking start debugging .
i think at this point, i’m ready to figure out how to create a patch. if i do, i may try patching that messed up documentation so that people won’t spend time looking for a non-existent menu. then i’ll write an article about how to submit a patch and use the issue tracker system for python.
Published at DZone with permission of Mike Driscoll, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.