473,403 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Python for .NET and IronPython

Hi all. I'm currently learning C#, and I'm also interested in learning
Python (all of this just for fun, mind you), so it seems like a decent
idea to want to integrate the two. But I don't quite understand the
difference between these two Python implementations and I was hoping
someone could explain.

Does either one require learning something different than the core
Python language? With IronPython, would you actually be writing .NET
code? I know Python for .NET is treated as a true language in the CLR,
but I don't quite grasp what all this means for each language, and what
the learning process for either language would be like as a result.

Thanks,
John
Nov 2 '05 #1
8 2029
John Salerno wrote:
code? I know Python for .NET is treated as a true language in the CLR,
but I don't quite grasp what all this means for each language


isn't* treated, I meant to say!
Nov 2 '05 #2
I was under the impression that IronPython is like CPython and Jython,
namely an implementation of the Python language. So in that sense it is
exactly like normal Python, although I don't know how convenient it is
to deploy.

I was also under the impression that Python for .NET is like an API
wrapper thingy, analagous to the win32com package that wraps that
interface and allows you to call functions and stuff provided by the
..NET API. It is not at all an implementation of Python.

I am confident that we will learn shortly whether I'm wrong.

Nov 2 '05 #3
For more information on Iron Python see http://www.ironpython.com/
My take on Iron Python is the new job the develolper of Iron Python
started last year takes up just about all of his time and the developer
is currently spending very little time actively developing Iron Python.
I suspect it will be a long time before Iron Python will be a main
stream product. Hence I suggest you spend your time learning Python and
C# and you forget about Iron Python until it is more fully developed.
Howard
John Salerno wrote:
Hi all. I'm currently learning C#, and I'm also interested in learning
Python (all of this just for fun, mind you), so it seems like a decent
idea to want to integrate the two. But I don't quite understand the
difference between these two Python implementations and I was hoping
someone could explain.

Does either one require learning something different than the core
Python language? With IronPython, would you actually be writing .NET
code? I know Python for .NET is treated as a true language in the CLR,
but I don't quite grasp what all this means for each language, and what
the learning process for either language would be like as a result.

Thanks,
John


Nov 3 '05 #4
IronPython is good if you want to bring in Python into a .NET world.

Python for .NET is good if you want to bring in .NET into a Python
world.

As for your learning concerns, there need be none. There is really
nothing to learn extra for the integration. They just work. Once you
learn the .NET framework and Python, there isn't much to know
additionally.

While you are on topic, check out Boo. It is not the same as the ones
you mentioned but you might find it interesting and useful while
working with .NET if you have Python tastes.

Nov 3 '05 #5

hrh1818 wrote:
For more information on Iron Python see http://www.ironpython.com/
My take on Iron Python is the new job the develolper of Iron Python
started last year takes up just about all of his time and the developer
is currently spending very little time actively developing Iron Python.


Actually, he just stopped updating ironpython.com (a bad idea, imo)
apparently.

Last release was 10/13 through Microsoft,
http://www.microsoft.com/downloads/d...DisplayLang=en

If that link doesn't work you can just search "IronPython" on
microsoft.com

Brett

Nov 3 '05 #6
hrh1818 <ho******@westerncom.net> wrote:
For more information on Iron Python see http://www.ironpython.com/
My take on Iron Python is the new job the develolper of Iron Python
started last year takes up just about all of his time and the developer
is currently spending very little time actively developing Iron Python.
I suspect it will be a long time before Iron Python will be a main
stream product. Hence I suggest you spend your time learning Python and
C# and you forget about Iron Python until it is more fully developed.


According to the guy who came present IronPython at EURO OScon, there's
now 1.5 people (both MS employees) working on IronPython -- the
presenter himself, fulltime, and Jim Hugunin, halftime. The language is
just about ready (with a few last decisions to make, such as, stick to
unicode-only strings like Jython, or strive for greater practical
compatibility with current CPython?); it passes the CPython unit-tests,
with a few adjustments needed where the tests overspecify some aspects
of behavior compared to the Language Manual.

What's missing is a lot of the Python standard library -- most of the
parts that are written in C in CPython (and, I believe, in Java in
Jython). My impression is that the realistic timeframe to implement
those is several months; meanwhile, IronPython is usable if you're
willing to make direct calls to the standard MSCLR libraries (i.e.,
forego ease of future moves to CPython).

A beginner might be best advised to stick with CPython (and, if DotNet
is needed, perhaps the Python-like language Boo) while IronPython
stabilizes and fleshes out, but I'm rather more optimistic than you
about the speed with which that will happen.
Alex
Nov 3 '05 #7

John Salerno wrote:
Hi all. I'm currently learning C#, and I'm also interested in learning
Python
In a similar position to yourself - learning both languages - I can
definitely recommend Python ( though C# 's curly brackets might annoy
you more than they did before!!)
so it seems like a decent
idea to want to integrate the two


FWIW, what I've been doing lately is calling Python scripts from
Windows.Forms apps, capturing their 'StdOut'. There's an article on
http://www.thecodeproject.com which explains how you can do this
asynchronously, but the following (C#) code is what I'm using ( imagine
a Windows Form with a TextBox to enter the script name, another to
enter any arguments for the script, and 'Run', 'Cancel' and 'Browse'
CommandButtons).
(assumes the script requires no user interaction)

private void BrowseForScript_Click(object sender, System.EventArgs e)
{
if ( this.openFileDialog.ShowDialog() == DialogResult.OK )
{
this.txtIO.Clear();
this.txtIO.Focus();
this.txtIO.AppendText( openFileDialog.FileName);
}
}

private void Run_Click(object sender, System.EventArgs e)
{
System.Diagnostics.ProcessStartInfo startInfo;
System.Diagnostics.Process process;
string directory;
string pyArgs;
string script;

script = this.txtIO.Text.Trim();

if ( script == null || script.Length == 0 )
{
return;
}

try
{
directory = Path.GetDirectoryName( script );
script = Path.GetFileName( script );
}
catch (ArgumentException)
{
MessageBox.Show("The script file path contains invalid characters.",
"Invalid Script Path",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
return;
}

if ( script.Length == 0 )
{
MessageBox.Show("No script file has been specified.",
"Invalid Script Path",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
return;
}

if ( directory == null || directory.Length == 0 )
{
directory = DEFAULT_SCRIPT_DIRECTORY;
}

pyArgs = this.txtArgs.Text.Trim();

startInfo = new ProcessStartInfo("python");
startInfo.WorkingDirectory = directory;
startInfo.Arguments = script + " " + pyArgs;
startInfo.UseShellExecute = false;
startInfo.CreateNoWindow = true;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;

process = new Process();
process.StartInfo = startInfo;
process.Start();

string s;
while ((s = process.StandardOutput.ReadLine()) != null)
{
this.__application.Write( s + "\n" );
}

while ((s = process.StandardError.ReadLine()) != null)
{
this.__application.Write( s + "\n" );
}
}
Gerard

Nov 3 '05 #8
I just want to clarify that the above mentioned web site
(www.ironpython.com) is no longer maintained.
If you want to get updated information on IronPython, you should visit
this site:
www.gotdotnet.com/Workspaces/Workspace.
aspx?id=ad7acff7-ab1e-4bcb-99c0-57ac5a3a9742

Or the mailing list here:
http://lists.ironpython.com/pipermai...ronpython.com/

By the way, the current version is 0.9.3 and it's advancing at a pretty
fast pace towards version 1.0.

Luis

Nov 3 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: MarcoL | last post by:
Hello, I am a VB6 programmer and I would like to learn a new high level language (instead of restarting from scratch with .NET), wich is opensource and cross-platform, in order to develop...
3
by: Carl Johan Rehn | last post by:
What is the difference between CPython, Python for .NET, and IronPython? For example, if I'm running IronPython, can I access modules such as Numeric and numarray? As I understand it,...
83
by: Licheng Fang | last post by:
Hi, I'm learning STL and I wrote some simple code to compare the efficiency of python and STL. //C++ #include <iostream> #include <string> #include <vector> #include <set> #include...
122
by: Edward Diener No Spam | last post by:
The definition of a component model I use below is a class which allows properties, methods, and events in a structured way which can be recognized, usually through some form of introspection...
6
by: mc | last post by:
Is there an easy way to compile a Python class (or set of classes) into a .DLL that a C# program can call? Or otherwise to use an existing library of Python classes from a C# program as seamlessly...
21
by: S.Mohideen | last post by:
Hi All, I was thinking about the feasbility of adjusting Python as a compiled language. Being said that I feel these are the following advantages of doing so -- 1) Using the powerful easy-to -use...
6
by: Siegfried Heintze | last post by:
I love the typing assist I get when using C# in VS2005 to write COM clients. I need to write a program to automate some tasks in outlook. Givin that the typing assist feature is very important to...
7
by: Fredrik Lundh | last post by:
M.-A. Lemburg wrote: Should that matter? Isn't IronPython pure CLR? </F>
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.