Can Any one tell me how to use phython with .net
and wat is the main use of phython

Can Any one tell me how to use phython with .net

There's a nice library out there conveniently called "Python for .NET" (link).

and wat is the main use of phython

Come on, at least spell Python correctly! Python, as defined by About.com, is:

Python is a general purpose programming language that is able to be used on any modern computer operating system. It may easily be used for processing text, numbers, images, scientific data, or anything else which one might save on a computer. It is used daily in the operations of the Google search engine, the video sharing web site YouTube, NASA , and the New York Stock Exchange. These are but a few of the places where Python plays important roles in the success of business, government, and non-profit organisations; there are many others.

Python is also an interpreted language. This means that it is not converted to computer-readable code before the program is run but at runtime. In days gone by, this type of language was called a scripting language, intimating its use for trivial or banal tasks. However, programming languages such as Python have forced a change in that nomenclature. Increasingly, large applications are written almost exclusively in Python. As mentioned above, in addition to being used by Google and NASA to complement other languages, Python is used almost exclusively for such applications as YouTube and the web-based transaction system of the New York Stock Exchance (NYSE).

Python for .Net is good, but IronPython is better.
It's Python written in C#, and you can use it with Visual Studio 2010.
Check out the main website.

Main use of Python?
It's easy and powerful.
You can embed it in your C# application if you want.
You can also use it with Microsoft Silverlight and ASP.NET.

You see, IronPython code looks like this:

import clr #clr module
clr.AddReference("System.Windows.Forms") #dynamically referencing
from System.Windows.Forms import * #bad practice, but same as using System.Windows.Forms;

myform = Form()
myform.Text = "Hello World"
Application.Run(myform)

Equivalent in C# (you should be familiar with this)
I know this isn't the way you would make a Windows application, but it's just an example.

using System;
using System.Windows.Forms;

class Program
{
    public static void Main(string[] args)
    {
        Form myform = new Form();
        myform.Text="Hello World";
        Application.Run(myform);
    }
}

Contact me for any questions about IronPython.
If you want to try IronPython in your browser without installing anything,
you can use this Silverlight application called
TryPython
it's basically IronPython console hosted in Silverlight.

Edited 6 Years Ago by jcao219: n/a

Why ironpython is better than python ? And how good is ironpython under macosx ?

Can ironpython use python libraries ?

Why ironpython is better than python ? And how good is ironpython under macosx ?

Can ironpython use python libraries ?

IronPython is not better than (C)Python.
It's better than Python for .NET if you want to use .NET libraries, because it is written in C#, and it is compiled to CIL.
There will be less problems that you run into, and it is easier to integrate with C# applications.

IronPython can use many Python libraries, but it has issues with the C libraries (but you can use IronClad to help resolve those issues)

IronPython can run under Mono for Mac.

Edited 6 Years Ago by jcao219: n/a

IronPython is not better than (C)Python.
It's better than Python for .NET if you want to use .NET libraries, because it is written in C#, and it is compiled to CIL.
There will be less problems that you run into, and it is easier to integrate with C# applications.

IronPython can use many Python libraries, but it has issues with the C libraries (but you can use IronClad to help resolve those issues)

IronPython can run under Mono for Mac.

Actually Python for .NET is very diffirent to ironpython. Ironpython is actually a .net programming langauge with the python synthax. While python for .NET executes the python runtime inside .NET

The great adavantage is that with python for .NEt you can use Cpython libraries which are the vast majority of python libraries out there , while with ironpython you cannot.

In that respect python for .net is actually better than ironpython But , its developemnt has stoped since 2007 as it appears in sourceforge.

Mono on mac, is not that realiable I am afraid, and winforms under macosx look very ugly.

Edited 6 Years Ago by thekilon: n/a

Why use IronPython in the first place? It's harder to port and it relies on a partially proprietary framework. Sure these frameworks are good and they make coding easy, especially GUI programming, but you'll going to end up stuck with Microsoft. (Mono is not exactly that great.)

Actually Python for .NET is very diffirent to ironpython. Ironpython is actually a .net programming langauge with the python synthax. While python for .NET executes the python runtime inside .NET

The great adavantage is that with python for .NEt you can use Cpython libraries which are the vast majority of python libraries out there , while with ironpython you cannot.

In that respect python for .net is actually better than ironpython But , its developemnt has stoped since 2007 as it appears in sourceforge.

Mono on mac, is not that realiable I am afraid, and winforms under macosx look very ugly.

Yes you can use CPython libraries with IronPython.
There's IronClad.
IronPython is a first-class citizen of .NET, so that makes it much better, and there are less issues.
Python for .NET has some bugs when you use it with .NET libraries.

For Mono, you never WinForms!
You use GTK#. Who uses WinForms these days anyways.

The huge disadvantages for Python for .NET -> very bad integration with C# or existing .NET applications,
no ASP.NET,
no Silverlight,
not native code,
no IDE support (IronPython has support via extension in Visual Studio 2010, the greatest of all IDE's).

If you use any .NET languages, you're pretty much shooting for Windows, which is what most people have anyways.
If I write a program for my friends in school, they would love for it to have a GUI interface (which I can design easily in IronPython with .NET libraries), and as an easy to run .exe.

Even better, I can put it online with Silverlight, and they don't even have to install anything.

Edited 6 Years Ago by jcao219: n/a

Yes you can use CPython libraries with IronPython.
There's IronClad.
IronPython is a first-class citizen of .NET, so that makes it much better, and there are less issues.
Python for .NET has some bugs when you use it with .NET libraries.

For Mono, you never WinForms!
You use GTK#. Who uses WinForms these days anyways.

The huge disadvantages for Python for .NET -> very bad integration with C# or existing .NET applications,
no ASP.NET,
no Silverlight,
not native code,
no IDE support (IronPython has support via extension in Visual Studio 2010, the greatest of all IDE's).

If you use any .NET languages, you're pretty much shooting for Windows, which is what most people have anyways.
If I write a program for my friends in school, they would love for it to have a GUI interface (which I can design easily in IronPython with .NET libraries), and as an easy to run .exe.

Even better, I can put it online with Silverlight, and they don't even have to install anything.

Very good points, however I am on the other hand a MACOSX developer who also happens to wants his code with no extra coding to work for windows and linux. GTK works very well on windows and of course Linux, but on MACOSX it needs X11 which is abit ugly and not terrible stable (see for example the very known image editor GIMP on mac). And since stability and looks on the mac is a very big deal, that is why .net languages never took off as much as they did with linux where mono is very popular.

But ironpython is a viable language for mac as well, just not as viable as python.

While on the other hand cpython has wxpython which look natively on mac even Jython through Java looks native, cause recently Sun took the right steps to make Java look native on mac and Apple actively support both Java and python.

This cool trick with Silverlight I am not aware of. There so many tips and trick with coding, its impossible to tell which is the best language.

Oh I forgot to add that even though I am a big hater of windows I love .NET. The reason is that I used to be a hardcore Delphi developer and the guy that created Delphi left Borland and created .NET which of course shares so many similarities with Delphi that ook me days to learn .NET. And since I am such a big admirer of Delphi .Net is close to my heart.

Now combine this with the fact that I love python , you can see that I see ironpython like a dream come true. Two of my favourite platforms united.

Very good points, however I am on the other hand a MACOSX developer who also happens to wants his code with no extra coding to work for windows and linux. GTK works very well on windows and of course Linux, but on MACOSX it needs X11 which is abit ugly and not terrible stable (see for example the very known image editor GIMP on mac). And since stability and looks on the mac is a very big deal, that is why .net languages never took off as much as they did with linux where mono is very popular.

But ironpython is a viable language for mac as well, just not as viable as python.

While on the other hand cpython has wxpython which look natively on mac even Jython through Java looks native, cause recently Sun took the right steps to make Java look native on mac and Apple actively support both Java and python.

This cool trick with Silverlight I am not aware of. There so many tips and trick with coding, its impossible to tell which is the best language.

Oh I forgot to add that even though I am a big hater of windows I love .NET. The reason is that I used to be a hardcore Delphi developer and the guy that created Delphi left Borland and created .NET which of course shares so many similarities with Delphi that ook me days to learn .NET. And since I am such a big admirer of Delphi .Net is close to my heart.

Now combine this with the fact that I love python , you can see that I see ironpython like a dream come true. Two of my favourite platforms united.

You love .NET, but you hate Microsoft Windows?
That's very unique.
Maybe someday, with Mono, .NET will be fully cross-platform.
It's definitely a powerful library.

Edited 6 Years Ago by jcao219: n/a

You love .NET, but you hate Microsoft Windows?
That's very unique.
Maybe someday, with Mono, .NET will be fully cross-platform.
It's definitely a powerful library.

Well I am a windows hater not a microsoft hater, on my mac I use microsoft office , which I prefer it from iWork alot more.


Talking about mono, I am just wondering how thing work. Does a .Net library automatically work under mono ?

I mean if a third party write a library , a dll, for .net and windows can I take this dll and use it in macos and linux with mono with no issues whatsoever ?

Is there a full support of .NET under mono for macos and linux ?

With python is abit more complicate because one have to write wrapper for each operation system in order to work as C++ is not cross platform in the sens of write once and run everywhere like Java.

While on the other hand , jython (python for java) because it is based on Java it works completely cross platform , a code that works for windows will work exactly the same for macosx and linux. I love that.

Does this apply for ironpython and c# under macosx ?

Edited 6 Years Ago by thekilon: n/a

Not necessarily for WinForms and WPF.
If you write a C# application,
you can just do mono MyApplication.exe and it will run.

Not necessarily for WinForms and WPF.
If you write a C# application,
you can just do mono MyApplication.exe and it will run.

So if I get a openGL library for .NET will work as it is for MACOSX and LINUX through mono?

So if I get a openGL library for .NET will work as it is for MACOSX and LINUX through mono?

I'm not sure. You'd have to try it.

I'm not sure. You'd have to try it.

thats is pretty much the only reason that kept me away from ironpython , I love the .Net architecture but mono is not a complete product at least for macos yet. I know that they still strugling with the GUI part.

While jython and python have a very good support for macos. I am not enjoying java as much as I enjoy C#, but JAVA works 100% on mac and so does jython. Even compared to python , jython and java is guaranted that something that works for windows will work with no problems or additional work for macos and linux.

I took a look at mono forums and seems that there are still several incompatibilities need to resolved for mac.

At the moment I am happy with python, as the libraries I use, like pygame, have really good crossplatfrom support, which for me is extremely important.

But I would like to thank you for your help , I will keep an eye on mono and ironpython.

This article has been dead for over six months. Start a new discussion instead.