Pythons and Visual Studio Development

Two little gems for today.

To run several versions of Python on a windows machine, install whatever versions of python you want, but don’t add them to your path variable. (This will be an option on the second page of the python installer.)

Instead when you want to run a version of Python, call directly to the exe.
ie:
C:/Python27/python.exe
or
C:/Python34/python.exe

This way you can play with all the Pythons you want!
Next is creating a shortcut for this because writing this every time is a bit tedious. Any tips?

Next Tidbit
If you’re using visual studio to develop a python project. You don’t have to run it with python. Simply open command prompt or powershell to the visual studio directory and it acts like any other file system.

eg:
I’m learning Django web framework, but I’m learning from tutorials that are agnostic, so I wasn’t sure if I was going to learn how to run the server or complete unit tests.

But no problems so far. Just treat visual studio like Sublime, and use a command prompt to test your code.

This is how I’m running my server from the command prompt!
C:/Python27/python.exe manage.py runserver

I’m run this below the .sln level
Djangoapp.sln
Djangoapp <---- CD into this file and run. Hooray! [caption id="attachment_1581" align="aligncenter" width="474"]THINK IBM has fight songs. Early adopter of “Company Culture”
Lots of awesome stuff at the Computer History Museum: Click on the photo to find out more. [/caption]

Python and Visual Studio in 5 minutes

Python is an excellent teaching programming language. It has all the tools to inspire students out of the box with plenty to grow on.

Development requires a basic understanding of computer science  but will teach essentials for large scale software development, object oriented design, polymorphism, and development environments.

I like python. The Zen is magnificent. It inspires me every time I practice and learn.

Microsoft arrives in the form of PTVS (Python Tools for Visual Studio) a powerful extension for Visual Studio that can be installed in all Versions of VS.

PTVS turns Visual Studio into a Python Dev Environment. Complete with Debugging, in window REPL (with autocomplete assistance), IntelliSense, configurable environments and virtual environments.

Its an extremely powerful tool.
While getting into PTVS I would recommend watching these two videos:


The second one especially will help you get a grip on how to configure development environments in Python, one of the most crucial parts of taking development to the next level.

Also, configuration of PIP, Setuptools, and virtualenv is all handled for you from there. Its freakin sweet. You can do all of this for free with Visual Studio Express.

Other helpful resources:
Python the Hard Way
Scott Hanselman’s Blog about PTVS
Pluralsight Subscribers
Python Tools for Visual Studio
Somasegar’s Post!

Let me know if you have any other questions!

9 Frisbees on Thumbtacks
We’ve started a Frisbee wall! FUNctional storage.