I want to my Hello world program to be executed in Visual Studio 2008.
- Is it possible to make my pyton run in Visual studio 2008. Please tell me the link or procedure to follow.
Answers
- Since you successfully installed the VS 2008 Shell Integrated Mode Redistributable Package and also Iron Phyton Studio Integrated Setup, as I understand, all you now have to do is start Visual Studio 2008.
When the IDE is up and running, go to File > New > Project... There you should find the Iron Python project templates.- Marked As Answer byeryangMSFT, ModeratorMonday, November 09, 2009 7:47 AM
- I'm glad that my answer got you started with IronPython and VS (please mark it as an answer, if you're happy with it).
Now to your other question. In the current release of IronPython Studio there is no web project template.
There is some *pre-release* documentation on MSDN regarding your topic of interest (http://msdn.microsoft.com/en-us/library/bb165160(VS.80).aspx), but this is an evolving theme, so let us wait for .NET 4.0 and the DLR.
You can find more interesting links here: http://ironpython-urls.blogspot.com/
Marcel- Marked As Answer byeryangMSFT, ModeratorMonday, November 09, 2009 7:47 AM
There is no integrated support for this in Visual Studio 2008 at this time.
Alan Harris's book Pro IronPython (apress, 2009) has an interesting chapter where he talks about calling IronPython code and also in chapter 8 (Caught In A Web) he talks about ASP.net and IronPython. In the absence of a web project template in VS 2008, the sample from http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=17613 could help you find your own way.
Marcel- Marked As Answer byeryangMSFT, ModeratorMonday, November 09, 2009 7:48 AM
All Replies
What about this: http://www.codeplex.com/IronPythonStudio ?
- Hi,
I have my VISUAL STUDIO 2008 already installed. All that I need to do is ,install the integrated Redistributable package which will allow me for using Python language .
can u please confirm this. - Hi,
please take a look at the comments on the downloads page http://ironpythonstudio.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=8934.
You'll need Visual Studio SP1, the Visual Studio 2008 Shell Integrated Mode Redistributable package and the IronPythonStudioIntegratedSetup .
Hope this helps.
Marcel - Hi,
I have installed the SP1,Visual Studio 2008 Shell Integrated Mode Redistributable package and the IronPythonStudioIntegratedSetup .
Now when i go to start -> Programs-> Iron Phyton Studio-> . I find only 'read me' document. Where do i find IronPhyton IDE. Can you Please tell me.
Should i have to install any thing else.
regards
Srik - Shoud i have to install Visual Studio shell integrated version.
Regards
Srikanth - Since you successfully installed the VS 2008 Shell Integrated Mode Redistributable Package and also Iron Phyton Studio Integrated Setup, as I understand, all you now have to do is start Visual Studio 2008.
When the IDE is up and running, go to File > New > Project... There you should find the Iron Python project templates.- Marked As Answer byeryangMSFT, ModeratorMonday, November 09, 2009 7:47 AM
- i got it. i did the same thing. I got it.
I want to have a web application develop from the Iron Python template. I do not find a option for Web Application. Is there any ways available.
Kindly let me know this.
Thanks
Srikanth - I'm glad that my answer got you started with IronPython and VS (please mark it as an answer, if you're happy with it).
Now to your other question. In the current release of IronPython Studio there is no web project template.
There is some *pre-release* documentation on MSDN regarding your topic of interest (http://msdn.microsoft.com/en-us/library/bb165160(VS.80).aspx), but this is an evolving theme, so let us wait for .NET 4.0 and the DLR.
You can find more interesting links here: http://ironpython-urls.blogspot.com/
Marcel- Marked As Answer byeryangMSFT, ModeratorMonday, November 09, 2009 7:47 AM
- i have one more query.
I have my business logic in python. My Ui needs to be developed in ASP.net.
It must be web application.
Is it possible in Visual studio. There is no integrated support for this in Visual Studio 2008 at this time.
Alan Harris's book Pro IronPython (apress, 2009) has an interesting chapter where he talks about calling IronPython code and also in chapter 8 (Caught In A Web) he talks about ASP.net and IronPython. In the absence of a web project template in VS 2008, the sample from http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=17613 could help you find your own way.
Marcel- Marked As Answer byeryangMSFT, ModeratorMonday, November 09, 2009 7:48 AM
- Thanks for your doubt.
Let me explain what i have done.
I have a created a separate project in C# . It is web application. I have separately built this.
Now i have created a separate Iron phyton project which contains the a class and a method. I have separately built this.
Now I have added the phyton project in the namespace of the C# project and i am able to build it.
BUT THE PROBLEM I AM FACING IS
I WANT TO INVOKE THE METHOD WRITTEN IN THE PHYTHON FROM C#.
CAN U HELP ME IN RESOLVING THIS AND MAKE ME MOVE FORWARD - What you want to do is not trivial. Writing IronPython code in Visual Studio 2008 (your original question) is one thing, calling IronPython code from a C# project a totally different one. Please take a look at the chapter Calling IronPython code from the above mentioned book (http://books.google.de/books?id=izFShORshFQC&pg=PA137&lpg=PA137&dq=%22namespace+IPEngine%22&source=bl&ots=ZFfSf5NHuq&sig=IkfcN64HaFyzbSiR95Tufl4t5ak&hl=de&ei=WtTzSqSyDI2SsAa4gb3cAQ&sa=X&oi=book_result&ct=result&resnum=1&ved=0CAgQ6AEwAA#v=onepage&q=%22namespace%20IPEngine%22&f=false).
You'll see what I mean. It is possible, but SOME WORK ON YOUR SIDE IS NECESSARY. It involves referencing IronPython.dll, IronPython.Modules.dll, Microsoft.Scripting.dll, Microsoft.Scripting.Core.dll and building a IronPython engine capable of executing IronPython code. I would definitely recommend you this book.
In inbox.py:
class InBox: "A class that manages incoming messages" def getmessage(self): return "This is a new message"
In C# library:
using System; using IronPython.Hosting; using Microsoft.Scripting.Hosting; //[...] ScriptEngine engine = Python.CreateEngine(); ScriptSource source = engine.CreateScriptSourceFromFile(pythonFile); ScriptScope scope = engine.CreateScope(); ObjectOperations operations = engine.Operations; source.Execute(scope); object inboxClass = scope.GetVariable("InBox"); object inboxInstance = operations.Call(inboxClass); object instanceMethod = operations.GetMember(inboxInstance, "getmessage"); string resultMessage = (string)operations.Call(instanceMethod); //[...]
Is this what you want?


