# Compile PyTeal File

You can not directly deploy a PyTeal file to create a stateful app or stateless logic sig file. The PyTeal file first needs to be compiled into a regular TEAL file and then the generated TEAL file can be used as part of stateful app or logic sig.

* To compile a PyTeal file, right click on the pyTeal file and select "Compile PyTeal".

![](/files/-MNgLE5z87Qjc6RFUYit)

* After PyTeal compilation, the final TEAL file is generated under **generated-src** folder.<br>

![](/files/-MNgL_KAQV5RSKltkCKo)

* Now you can use this generated TEAL file as a regular TEAL file.&#x20;

&#x20;For example:  Create a Logic Sig from this generated TEAL file or create a stateful app.

![](/files/-MNgM2WxnocJVtTw3aDL)


---

# 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/compile-pyteal-file.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.
