.py
💻 CodeText-based

.py File — Python Script

text/x-python

File Inspector

Drop any file to identify its extension and type — runs entirely in your browser

PY

Drop a .py file here or click to choose

Or drop any file to identify its extension

Expected MIME type:text/x-python

Quick Facts

Extension.py
Full NamePython Script
MIME Typetext/x-python
CategoryCode
TypeText-based (human-readable)
Typical Size1 KB – 200 KB
First Appeared1991

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

VS Code
PyCharm
Sublime Text
vim
IDLE
Jupyter
Spyder
any text editor

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.