.py — Python Script
Source code for the Python programming language, run by the Python interpreter rather than compiled ahead of time.
Also known as: .pyw
Scripts can run commands on your computer when executed. Only run scripts from sources you trust, and review the contents in a text editor first if you're unsure.
Check another filename
File extension lookup
Frequently asked questions
What is a .py file?
Source code for the Python programming language, run by the Python interpreter rather than compiled ahead of time.
Can I edit a .py file?
Yes — .py files are commonly editable with software such as Python interpreter.
Does having a .py extension mean the file is safe?
No single extension can guarantee that. Scripts can run commands on your computer when executed. Only run scripts from sources you trust, and review the contents in a text editor first if you're unsure. Always consider where the file came from, not just its name.