![]() |
VOOZH | about |
dotnet add package Kephas.Scripting.Python --version 11.1.0
NuGet\Install-Package Kephas.Scripting.Python -Version 11.1.0
<PackageReference Include="Kephas.Scripting.Python" Version="11.1.0" />
<PackageVersion Include="Kephas.Scripting.Python" Version="11.1.0" />Directory.Packages.props
<PackageReference Include="Kephas.Scripting.Python" />Project file
paket add Kephas.Scripting.Python --version 11.1.0
#r "nuget: Kephas.Scripting.Python, 11.1.0"
#:package Kephas.Scripting.Python@11.1.0
#addin nuget:?package=Kephas.Scripting.Python&version=11.1.0Install as a Cake Addin
#tool nuget:?package=Kephas.Scripting.Python&version=11.1.0Install as a Cake Tool
The Python scripting area in Kephas handles Python dynamic code execution using IronPython.
Check the following packages for more information:
// normally you would get the processor injected into the service constructor.
var processor = injector.Resolve<IScriptProcessor>();
var result = await processor.ExecuteAsync(new PythonStringScript("name[..4] + str(age)"), new Expando { ["name"] = "Johnny", ["age"] = 42 })).PreserveThreadContext();
Assert.Equals("John42", result);
The file scripts assume that the language can be inferred from the file extension.
For Python, it means that the file needs to and with a *.py extension.
If this is not the case, make sure you specify the language explicitly when creating a FileScript.
// normally you would get the processor injected into the service constructor.
var processor = injector.Resolve<IScriptProcessor>();
// Python scripts ending with *.py
var result = await processor.ExecuteAsync(new FileScript("myscript.py"), new { name = "Johnny", age = 42 })).PreserveThreadContext();
Assert.Equals("John42", result);
// Python scripts not ending with *.py
var result = await processor.ExecuteAsync(new FileScript("myscript.txt", PythonLanguageService.Language), new { name = "Johnny", age = 42 })).PreserveThreadContext();
Assert.Equals("John42", result);
PythonLanguageServiceThis service is the ILanguageService implementation for the Python language.
It uses the PythonSettings to configure the way it controls the execution. These are the options:
Note: The search paths are locations handled by the
ILocationsManagerservice. When adding tenant support, each tenant will get its own copy.
{
"searchPaths": [ "../config/.pylib" ],
"preloadGlobalModules": true
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 netstandard2.1 is compatible. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.1.0 | 1,033 | 4/13/2022 |
| 11.1.0-dev.4 | 315 | 4/6/2022 |
| 11.1.0-dev.3 | 310 | 3/30/2022 |
| 11.1.0-dev.2 | 291 | 3/23/2022 |
| 11.1.0-dev.1 | 305 | 3/23/2022 |
| 11.0.0 | 696 | 3/11/2022 |
| 11.0.0-dev.7 | 298 | 3/7/2022 |
| 11.0.0-dev.6 | 328 | 2/28/2022 |
| 11.0.0-dev.5 | 315 | 2/26/2022 |
| 11.0.0-dev.4 | 327 | 2/24/2022 |
| 11.0.0-dev.3 | 299 | 2/23/2022 |
| 11.0.0-dev.2 | 304 | 2/18/2022 |
| 11.0.0-dev.1 | 328 | 2/7/2022 |
| 10.3.0 | 678 | 1/18/2022 |
| 10.2.0 | 1,071 | 12/3/2021 |
| 10.1.0 | 5,119 | 11/23/2021 |
| 10.1.0-dev.7 | 368 | 11/17/2021 |
| 10.1.0-dev.6 | 333 | 11/16/2021 |
| 10.1.0-dev.5 | 373 | 11/10/2021 |
| 10.1.0-dev.4 | 348 | 11/8/2021 |
Please check https://github.com/kephas-software/kephas/releases for the change log.
Also check the documentation and the samples from https://github.com/kephas-software/kephas/wiki and https://github.com/kephas-software/kephas/tree/master/Samples.