IronPython.Console
3.4.0-beta1
See the version list below for details.
dotnet tool install --global IronPython.Console --version 3.4.0-beta1
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local IronPython.Console --version 3.4.0-beta1
#tool dotnet:?package=IronPython.Console&version=3.4.0-beta1&prerelease
nuke :add-package IronPython.Console --version 3.4.0-beta1
IronPython 3
There is still much that needs to be done to support Python 3.x. We are working on it, albeit slowly. We welcome all those who would like to help!
IronPython is an open-source implementation of the Python programming language which is tightly integrated with .NET. IronPython can use .NET and Python libraries, and other .NET languages can use Python code just as easily.
IronPython 3 targets Python 3, including the re-organized standard library, Unicode strings, and all of the other new features.
What? | Where? |
---|---|
Windows/Linux/macOS Builds | |
Downloads | |
Help |
Examples
The following C# program:
using System.Windows.Forms;
MessageBox.Show("Hello World!", "Greetings", MessageBoxButtons.OKCancel);
can be written in IronPython as follows:
import clr
clr.AddReference("System.Windows.Forms")
from System.Windows.Forms import MessageBox, MessageBoxButtons
MessageBox.Show("Hello World!", "Greetings", MessageBoxButtons.OKCancel)
Here is an example how to call Python code from a C# program.
var eng = IronPython.Hosting.Python.CreateEngine();
var scope = eng.CreateScope();
eng.Execute(@"
def greetings(name):
return 'Hello ' + name.title() + '!'
", scope);
dynamic greetings = scope.GetVariable("greetings");
System.Console.WriteLine(greetings("world"));
This example assumes that IronPython
has been added to the C# project as a NuGet package.
Code of Conduct
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information see the .NET Foundation Code of Conduct.
State of the Project
The current target is Python 3.4, although features and behaviors from later versions may be included.
See the following lists for features from each version of CPython that have been implemented:
- What's New In Python 3.0
- What's New In Python 3.1
- What's New In Python 3.2
- What's New In Python 3.3
- What's New In Python 3.4
- What's New In Python 3.5
- What's New In Python 3.6
Contributing
For details on contributing see the Contributing article.
Upgrading from IronPython 2
For details on upgrading from IronPython 2 to 3 see the Upgrading from IronPython 2 to 3 article.
Differences with CPython
While compatibility with CPython is one of our main goals with IronPython 3, there are still some differences that may cause issues. See Differences from CPython for details.
Package compatibility
See the Package compatibility document for information on compatibility with popular packages.
Installation
Binaries of IronPython 3 can be downloaded from the release page, available in various formats: .msi
, .zip
, .deb
, .pkg
. The IronPython package is also available on NuGet.
Build
See the building document. Since the main development is on Windows, bugs on other platforms may inadvertently be introduced - please report them!
Supported Platforms
IronPython 3 targets .NET Framework 4.6.2, .NET Standard 2.0, .NET Core 3.1 and .NET 6.0. The support for .NET and .NET Core follow the lifecycle defined on .NET and .NET Core Support Policy.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
This package has no dependencies.
Version | Downloads | Last updated |
---|---|---|
3.4.0 | 2 | 12/4/2022 |
3.4.0-beta1.5 | 1 | 10/7/2022 |
3.4.0-beta1.4 | 7 | 10/2/2022 |
3.4.0-beta1.3 | 3 | 9/30/2022 |
3.4.0-beta1.2 | 2 | 9/30/2022 |
3.4.0-beta1.1 | 3 | 9/30/2022 |
3.4.0-beta1 | 3 | 9/30/2022 |