Skip to main content
`Ctrl`+`K`

# PetscPythonInitialize

Initialize Python for use with PETSc and import petsc4py.

## Synopsis

    #include "petscsys.h"
    PetscErrorCode PetscPythonInitialize(const char pyexe[], const char pylib[])

## Input Parameters

- pyexe - path to the Python interpreter executable, or `NULL`.

- pylib - full path to the Python dynamic library, or `NULL`.

## Options Database Key

- -python exe - Initializes Python, and optionally takes a Python executable name

## See Also

`PetscPythonFinalize()`, `PetscPythonPrintError()`

## Level

intermediate

## Location

src/sys/python/pythonsys.c

## Examples

src/ksp/ksp/tutorials/ex100f.F90
src/ksp/ksp/tutorials/ex100.c

Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages