> For the complete documentation index, see [llms.txt](https://algodea-docs.bloxbean.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://algodea-docs.bloxbean.com/compile-pyteal-file.md).

# 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".

![](https://1148938711-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MKjsRBIKLQhzDC7WBQY%2F-MNg7aeVcyi_3ZHhYm3C%2F-MNgLE5z87Qjc6RFUYit%2Fpyteamcompile.png?alt=media\&token=d3b6b141-5c94-4ff5-aa7e-3bdbc8814e76)

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

![](https://1148938711-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MKjsRBIKLQhzDC7WBQY%2F-MNg7aeVcyi_3ZHhYm3C%2F-MNgL_KAQV5RSKltkCKo%2Fpyteal-generated-src.png?alt=media\&token=c859a913-6e3d-4b2d-9f37-f8b62d3f77c6)

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

![](https://1148938711-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MKjsRBIKLQhzDC7WBQY%2F-MNg7aeVcyi_3ZHhYm3C%2F-MNgM2WxnocJVtTw3aDL%2Fpyteal-logicsig.png?alt=media\&token=91d72e4b-59ad-486b-83ab-85b210b30ade)
