.py File — Python Script
text/x-python
Drop any file to identify its extension and type — runs entirely in your browser
Drop a .py file here or click to choose
Or drop any file to identify its extension
text/x-pythonQuick Facts
| Extension | .py |
| Full Name | Python Script |
| MIME Type | text/x-python |
| Category | Code |
| Type | Text-based (human-readable) |
| Typical Size | 1 KB – 200 KB |
| First Appeared | 1991 |
What Is a .py File?
Python is a high-level, interpreted programming language known for its emphasis on readability, simplicity, and versatility. Created by Guido van Rossum and first released in 1991, Python uses significant whitespace (indentation) to delimit code blocks, enforcing clean and consistent formatting. PY files contain Python source code that is executed by the Python interpreter (CPython, PyPy, or others). Python has become one of the most popular programming languages worldwide, dominant in data science, machine learning, artificial intelligence, scientific computing, web development (Django, Flask, FastAPI), automation, scripting, and education. The language's extensive standard library ("batteries included") and the massive PyPI ecosystem (over 400,000 packages) provide ready-made solutions for virtually any task. Python supports multiple programming paradigms including procedural, object-oriented, and functional programming. Python 3 (the current major version) introduced significant improvements including better Unicode support, f-strings, type hints, async/await, and walrus operator. Python's simplicity makes it the most popular first programming language in university curricula worldwide.
How to Open .py Files
Related File Extensions
More Code File Extensions
Other code formats you might encounter
Browse File Extensions by Category
Explore our reference of 259 file extensions with details, programs, and related formats.