PythonConsoleControlV2 1.0.0
dotnet add package PythonConsoleControlV2 --version 1.0.0
NuGet\Install-Package PythonConsoleControlV2 -Version 1.0.0
<PackageReference Include="PythonConsoleControlV2" Version="1.0.0" />
<PackageVersion Include="PythonConsoleControlV2" Version="1.0.0" />
<PackageReference Include="PythonConsoleControlV2" />
paket add PythonConsoleControlV2 --version 1.0.0
#r "nuget: PythonConsoleControlV2, 1.0.0"
#:package PythonConsoleControlV2@1.0.0
#addin nuget:?package=PythonConsoleControlV2&version=1.0.0
#tool nuget:?package=PythonConsoleControlV2&version=1.0.0
PythonConsoleControlV2 (.NET library)
PythonConsoleControlV2 is a WPF control that puts a live IronPython prompt inside your
application. Drop IronPythonConsoleControl into a window and you get a REPL with syntax
highlighting, code completion and command history, drawn by AvalonEdit. Hand it objects from
your app and users script against them while the app runs.
| Package ID | PythonConsoleControlV2 |
| Control | IronPythonConsoleControl |
| Target frameworks | net481, net10.0-windows |
| Runtime | Windows only, WPF |
| Python | IronPython 3.4.2 |
| License | LGPL-3.0-only |
Requirements
- Windows, with WPF.
- .NET Framework 4.8.1 or .NET 10.
- Nothing else to install. NuGet brings in IronPython 3.4.2 and AvalonEdit 6.3.1.
Installation
dotnet add package PythonConsoleControlV2
Or add a PackageReference:
<PackageReference Include="PythonConsoleControlV2" Version="1.0.0" />
Getting started
Declare the namespace and place the control:
<UserControl xmlns:console="clr-namespace:PythonConsoleControl;assembly=PythonConsoleControl">
<console:IronPythonConsoleControl Name="console" />
</UserControl>
Wait for the engine, then publish your own objects into the prompt:
console.Pad.Host.ConsoleCreated += (s, e) =>
console.Pad.Console.ConsoleInitialized += (s2, e2) =>
console.Pad.Console.ScriptScope.SetVariable("app", myApplication);
A user now types app.Documents.Count and reads the answer against live state.
To run a script instead of a typed line, call console.Pad.Console.RunStatements(text).
Notes
Ctrl-C interrupts a running script. On .NET Framework the control aborts the worker thread. On
.NET 10 Thread.Abort throws, so the control raises a flag and an IronPython trace hook stops
the script at its next traced event. That hook costs a callback per event, so scripts run
slower on .NET 10 than on .NET Framework.
Add the AvalonEdit highlighting definition yourself if you want colour in your own editor pane. The control highlights its own prompt buffer.
This is a fork of Joe Moorhouse's PythonConsoleControl from the
IronLab project, moved to IronPython 3 and AvalonEdit 6.
© 2010 Joe Moorhouse. Modifications © 2026 Stephen S. Mitchell. Released under the GNU Lesser General Public License v3.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows7.0 is compatible. |
| .NET Framework | net481 is compatible. |
-
.NETFramework 4.8.1
- AvalonEdit (>= 6.3.1.120)
- IronPython (>= 3.4.2)
-
net10.0-windows7.0
- AvalonEdit (>= 6.3.1.120)
- IronPython (>= 3.4.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 54 | 9/21/2026 |
v1.0.0 - First release of this fork. Moves the engine from IronPython 2.7.10 to 3.4.2. Replaces the vendored AvalonEdit 4.0.0.5949 binary with the AvalonEdit 6.3.1.120 package, which changed six call sites: PerformRectangularPaste takes a TextViewPosition, Selection.GetText and ReplaceSelectionWithText lost their arguments, IsMultiline became a property, TextArea.ClearSelection replaced Selection.Empty, and HighlightingColorizer takes an IHighlightingDefinition. Adds a .NET 10 (Windows) target beside .NET Framework 4.8.1. Ctrl-C stops a running script on both: .NET Framework aborts the worker thread, .NET 10 uses an IronPython trace hook because Thread.Abort throws there.