views:

69

answers:

3

I would like to know how to use Visual Studio with CPython (the official python.org python interpreter, not IronPython).

In particular, I am interested in getting "build" and "run" commands in Visual Studio working. Other features such as color highlighting and auto-complete, I am less concerned about.

Also, can the "build" command be made to run py2exe or similar exe packagers?

+1  A: 

Eclipse and PyDev already provide an excellent development environment for Python. Is there any reason you cannot use them?

Justin Ethier
I am not really developing through Visual Studio. The only real project requirement is that all of the code can be built and run through the visual studio build and run commands. This is my problem.
A: 

You can create custom project that will execute a bat file when building. I remember that I used this method to generate a Inoosetup installer so that you should work to run the py2exe script.

I have no idea for the rest of the features. The syntax highlighting and the auto-complete should be much more challenging. I would recommend to give a try to Komodo Edit or Eclipse/Pydev. It works out of the box

luc
How do I configure Visual Studio to use a BAT file for building?
I don't have VS installed anymore so I can't telle exactly but when you create a project you can choose one specific type (custom or something like that) and configure it to build with the command line you want. Sorry for not being very clear.
luc
+1  A: 

Are you trying to build CPython itself? Doesn't it come with project files suitable for use with Visual Studio? (I seem to remember that it did.)

If you mean that you want to use CPython but not build it, then just type c:\pythonxx\python.exe into the debugging executable and in the arguments put your script's full path name.

Create a makefile project and you can do whatever you want with the build rules to get "build" to function.

dash-tom-bang