--- title: ".py file — what it is and how to open it" description: "A .py file is a Python Source. A Python program in plain text — needs the Python interpreter to run. How to open one on Windows, macOS and Linux, and what to convert it to." url: https://atoneplace.net/file/py/ site: "At One Place" --- # .py files **.py file: Python Source** A Python program in plain text — needs the Python interpreter to run. ## What opens a .py file - **Windows:** Visual Studio Code, IDLE (with Python), PyCharm, Notepad (built in) - **macOS:** Visual Studio Code, IDLE (with Python), PyCharm, TextEdit (built in) - **Linux:** Visual Studio Code, Text Editor (built in), PyCharm - **In a browser:** Google Colab, Replit ## What a .py file is Python is the language of data science, scripting and much of modern automation. A .py file is readable text; running it needs Python installed, which macOS and Linux usually have and Windows does not by default — the Microsoft Store version is the simplest fix. Double-clicking on Windows runs the script in a console window that closes instantly when it finishes, which is why beginners think nothing happened. ## Converting it A .py file is commonly converted to .ipynb, .exe or .txt. It is a plain text format, so any text editor can open and edit it directly. ## Details - **Extension:** .py - **Full name:** Python Source - **Category:** Code and scripts - **MIME type:** text/x-python - **Created by:** Python Software Foundation - **Format:** Plain text ## Common questions ### How do I open a .py file? On Windows use Visual Studio Code; on macOS use Visual Studio Code; on Linux use Visual Studio Code. A Python program in plain text — needs the Python interpreter to run. ### What is a .py file? Python Source. Python is the language of data science, scripting and much of modern automation. A .py file is readable text; running it needs Python installed, which macOS and Linux usually have and Windows does not by default — the Microsoft Store version is the simplest fix. ### Can I convert a .py file? Yes. It is usually converted to .ipynb, .exe or .txt, either by exporting from one of the programs listed above or with a format converter. ## Related pages - [.html — HyperText Markup Language](https://atoneplace.net/file/html/) - [.js — JavaScript Source](https://atoneplace.net/file/js/) - [.css — Cascading Style Sheet](https://atoneplace.net/file/css/) - [.java — Java Source](https://atoneplace.net/file/java/) - [.tsx — TypeScript Source (JSX)](https://atoneplace.net/file/tsx/) - [.cpp — C++ Source](https://atoneplace.net/file/cpp/) - [.php — PHP Source](https://atoneplace.net/file/php/) - [.c — C Source](https://atoneplace.net/file/c/) - [.cs — C# Source](https://atoneplace.net/file/cs/) - [.go — Go Source](https://atoneplace.net/file/go/) - [.rs — Rust Source](https://atoneplace.net/file/rs/) - [.rb — Ruby Source](https://atoneplace.net/file/rb/) ## Sources - Media Types Registry — IANA (https://www.iana.org/assignments/media-types/) - Official vendor product documentation — At One Place (/about/)