:orphan:
# PCPythonSetType
Initialize a `PC` object implemented in Python, a `PCPYTHON`. 
## Synopsis
```
#include "petscpc.h" 
PetscErrorCode PCPythonSetType(PC pc, const char pyname[])
```
Collective


## Input Parameters

- ***pc -*** the preconditioner (`PC`) context.
- ***pyname -*** full dotted Python name [package].module[.{class|function}]



## Options Database Key

- ***-pc_python_type <pyname> -*** python class





## See Also
 `PC`, `PCSHELL`, `PCCreate()`, `PCSetType()`, `PCPYTHON`, `PetscPythonInitialize()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/python/pythonpc.c.html#PCPythonSetType">src/ksp/pc/impls/python/pythonpc.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex100.c.html">src/ksp/ksp/tutorials/ex100.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex100f.F90.html">src/ksp/ksp/tutorials/ex100f.F90</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/pc/impls/python/pythonpc.c)


[Index of all PC routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
