Wednesday, December 11, 2013

Creating first python application in Visual Studio

Before some time I have blogged about Python tools in Visual Studio and explained how we install python tools with visual studio and start developing python application with the one of greatest editor in class Visual Studio. In this post we are going to learn how we can create a python application in Visual Studio.

First check whether Python Interpreters are install on your machine or not?


First step for creating python application with Visual Studio is to check whether Python interpreters are installed or not not. To Check this after installing Python tools for Visual Studio go to Tools menu –> Python Environments and it will show a list of python environments available.

Python Enviroments for Visual Studio

If it is not installed, you need to download from http://www.python.org/. I have already installed Python 3.3 so its showing there.

Creating first python application:


Once you install Python tools for visual studio it will also have options to create python application in visual studio. So go to file menu –> new project options->templates-> Select python it will show all the python options available for visual studio just like below.

Visual Studio Python Project Templates

There you have few options like below.
  • From Existing Python Code
  • Python Application
  • Django Project
  • Python MPI Application
  • IronPython Application
  • IronPython WPF application
  • IronPython Silverlight Web page
  • IronPython Windows application
As we need to create a simple application for python we are going to our first application with Python application.Once create project it will create application like following.

Python application in visual studio solution explorer

Now open that PythonApplication1.Py and write following code.

Python Hello World application with Visual Studio

And now run application via pressing f5.

PythonApplicationfromvisualStudioOutput

That’s it we are able to run our first application in Visual Studio. Woohoo!! Hope you like it. Stay tuned for more..
Share:

2 comments:

  1. Hi Jalpesh It's Okay ..Can u please send ne Multiple Form Window Application in Pyhon

    ReplyDelete
    Replies
    1. By default python does not provide windows forms application.You either have to use Ironpython which is a .net port of python application.

      Delete

Your feedback is very important to me. Please provide your feedback via putting comments.

Search This Blog
Loading...
About Me
My Photo

Full Stack Developer,Blogger,Microsoft Mvp, Mentor, Life long learner, 10+ Years of Experience for JavaScript, web and Microsoft technologies. ASP.NET MVC,Web Forms,C#,AngularJs,Golang
Mvp profile
Subscribe to my blog

Enter your email address:

Follow us on facebook
Blog Archive
Total Pageviews