Skip to content
TheFilesGuy
en
Menu

Web & code · .py

What Is a PY File?

A .py file is a program written in the Python language.

Extension
.py
Full name
Python script
Type
Web & code
MIME type
text/x-python

Free PY Tools

These run in your browser. Your PY files are never uploaded.

About PY Files

A .py file contains Python source code. Python is one of the most popular programming languages, used for automation, data analysis, machine learning, web servers and teaching. The file is plain text. To run it you need Python installed; it comes with most Linux systems, and can be installed from python.org or the Microsoft Store on Windows.

How to Open a PY File

Any device
Open it in a text editor, VS Code or PyCharm to read it.
Run it
Install Python and run python file.py in a terminal.

PY File Questions

How do I run a .py file on Windows?

Install Python from python.org or the Microsoft Store, then run py file.py in Command Prompt.

Is it safe to run a Python script?

Only if you trust its source, because it can do anything your user account can. Read it first.

See all file formats