PythonShell.NET 0.0.5

dotnet add package PythonShell.NET --version 0.0.5                
NuGet\Install-Package PythonShell.NET -Version 0.0.5                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PythonShell.NET" Version="0.0.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PythonShell.NET --version 0.0.5                
#r "nuget: PythonShell.NET, 0.0.5"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install PythonShell.NET as a Cake Addin
#addin nuget:?package=PythonShell.NET&version=0.0.5

// Install PythonShell.NET as a Cake Tool
#tool nuget:?package=PythonShell.NET&version=0.0.5                

<h1 align="center"> <br /> PythonShell.NET </h1> <h3 align="center"> Python Environment Manager and Executor for .NET <br /> <br /> </h3> <br />

Available for:

  • net5.0, net6.0

Supported Platforms:

  • Windows 10+ (x86, amd64, arm64)
  • Linux Distos (amd64, arm64)
  • OSX 11+ (amd64, arm64)

<br /> <hr> <br /> <br />

Install

nuget package is not available not

<br /><br />

Usage

  • basic usage
using PythonShell.Listener;
using PythonShell.Shell;

var shell = new PythonShell.PythonShell(
    new PythonShell.PythonShellConfig()
);
await shell.Initialize();

shell.RunString("{pythonCode}");
  • use instance
using PythonShell.Listener;
using PythonShell.Shell;

new PythonShell.PythonShell(
    new PythonShell.PythonShellConfig()
).Initialize();

var instance = ShellManager.GetInstance("default");
instance.RunString("{pythonCode}");

<br />

  • onMessage, onError, onComplete
// setups like above ...
shell.RunString(
    "{pythonCode}",
    listener: ShellListener {
        OnMessage = (message) {
            // if `echo` is `true`, log to console automatically
            Console.WriteLine("message!");
        },
        OnError =  (e) {
            Console.WriteLine(e.Data);
        },
        OnComplete = () {
            Console.WriteLine("complete!");
        }
    }
);

<br />

for further informations, refers to PythonShell.cs

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.
  • net6.0

    • No dependencies.

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
0.0.5 468 10/21/2022
0.0.5-rc1 153 10/26/2022
0.0.4 422 10/19/2022
0.0.3 504 10/19/2022 0.0.3 is deprecated.
0.0.2 376 10/19/2022