# Create or Configure a Stateful Contract with PyTeal Programs

You can create a new stateful contract configuration and set a PyTeal program as approval or clear state program for the stateful application.

To create a new stateful contract configuration,

* Right click on the project > New > Stateful TEAL Configuration

![](https://1148938711-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MKjsRBIKLQhzDC7WBQY%2F-MNg6siU4grplyadD3cJ%2F-MNg7ZbDGih6i6dGGeJa%2FStatefulPyTealContract.png?alt=media\&token=2607cf80-3821-4f8a-ace1-1e440a086507)

* Provide contract name, approval program and clear state program

![](https://1148938711-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MKjsRBIKLQhzDC7WBQY%2F-MNg7aeVcyi_3ZHhYm3C%2F-MNgJGQgi5AeKIzbLvJC%2FSfconfig-1.png?alt=media\&token=9c0e4420-32cc-4d9b-8c11-3a7a750a093a)

* Select PyTeal program for both approval and clearstate program

![](https://1148938711-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MKjsRBIKLQhzDC7WBQY%2F-MNg7aeVcyi_3ZHhYm3C%2F-MNgJR9U7Hhz61mLuIaY%2FSfcontract-config.png?alt=media\&token=06ac3675-2ecf-4b93-94ec-922462939bf7)

* Notice that when you select a .py file for approval / clear state program, the value will be converted to \*.teal file in the generated-src folder. That's because the pyteal file is compiled into TEAL file during pyteal compilation.

![](https://1148938711-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MKjsRBIKLQhzDC7WBQY%2F-MNg7aeVcyi_3ZHhYm3C%2F-MNgJgd4J5nlpYkL4tPC%2Fsfconfig-3.png?alt=media\&token=6a2b967a-a882-4f0e-ae4c-4128ab768563)
