Movatterモバイル変換


[0]ホーム

URL:


ContentsMenuExpandLight modeDark modeAuto light/dark, in light modeAuto light/dark, in dark modeSkip to content
Python.NET documentation
Python.NET documentation

Contents:

Back to top

Python Reference

Runtime loading and configuration

Python.NET runtime loading and configuration

pythonnet.get_runtime_info()RuntimeInfo|None

Retrieve information on the configured runtime

pythonnet.load(runtime:Runtime|str|None=None,**params:str)None

Load Python.NET in the specified runtime

The same parameters as forset_runtime can be used. By default,set_default_runtime is called if no environment has been set yet and noparameters are passed.

After a successful call, further invocations will return immediately.

pythonnet.set_runtime(runtime:Runtime|str,**params:str)None

Set up a clr_loader runtime without loading it

Parameters:

runtime – Either an already initialisedclr_loader runtime, or one of netfx,coreclr, mono, or default. If a string parameter is given, the runtimewill be created.

pythonnet.set_runtime_from_env()None

Set up the runtime using the environment

This will use the environment variable PYTHONNET_RUNTIME to decide theruntime to use, which may be one of netfx, coreclr or mono. The parametersof the respective clr_loader.get_<runtime> functions can also be given asenvironment variables, namedPYTHONNET_<RUNTIME>_<PARAM_NAME>. Inparticular, to usePYTHONNET_RUNTIME=coreclr, the variablePYTHONNET_CORECLR_RUNTIME_CONFIG has to be set to a valid.runtimeconfig.json.

If no environment variable is specified, a globally installed Mono is usedfor all environments but Windows, on Windows the legacy .NET Framework isused.

pythonnet.unload()None

Explicitly unload a loaded runtime and shut down Python.NET

On this page

[8]ページ先頭

©2009-2025 Movatter.jp