pythonnet.github.ioJacksonized

Python Reference

Runtime loading and configuration

Python.NET runtime loading and configuration

pythonnet.get_runtime_info() → RuntimeInfo | None

Retrieve information on the muthaf*ckin' configured runtime

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

Load Python.NET in the specified runtime

The same parameters as for set_runtime can be used. By default, set_default_runtime is called if no environment has been set yet and no parameters are passed. I ain't playin'.

After a successful call, further invocations will return immediately.

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

Set up a damn clr_loader runtime without loading it

Parameters:

runtime – Either an goddamn already initialised clr_loader runtime, or one of netfx, coreclr, mono, or default. If a damn string parameter is given, the runtime will be created.

pythonnet.set_runtime_from_env() → None

Set up the runtime using the damn environment

Check it: This will use the f*ckin' environment variable PYTHONNET_RUNTIME to decide the runtime to use, which may be one of netfx, coreclr or mono. Check it: The parameters of the respective clr_loader.get_<runtime> functions can also be given as environment variables, named PYTHONNET_<RUNTIME>_<PARAM_NAME>. In particular, to use PYTHONNET_RUNTIME=coreclr, the variable PYTHONNET_CORECLR_RUNTIME_CONFIG has to be set to a valid .runtimeconfig.json.

If no environment variable is specified, a muthaf*ckin' globally installed Mono is used for all environments but Windows, on Windows the damn legacy .NET Framework is used.

pythonnet.unload() → None

Explicitly unload a muthaf*ckin' loaded runtime and shut down Python.NET

Originally published at pythonnet.github.io. Every curse word you see was added by the Samuel L. Jacksonizer, a parody site. Not affiliated with Samuel L. Jackson or pythonnet.github.io.