# 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

![](/files/-MNg7ZbDGih6i6dGGeJa)

* Provide contract name, approval program and clear state program

![](/files/-MNgJGQgi5AeKIzbLvJC)

* Select PyTeal program for both approval and clearstate program

![](/files/-MNgJR9U7Hhz61mLuIaY)

* 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.

![](/files/-MNgJgd4J5nlpYkL4tPC)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://algodea-docs.bloxbean.com/create-or-configure-a-stateful-contract-with-pyteal-programs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
