.py · 100% private

Open Python files online

Drop a Python file to preview it instantly in your browser. Free and private: your file is never uploaded, and no account is needed.

Drop your Python file here
or click to browse your device
file
Preview
Drop a file on the panel above to begin
Files never leave your device No sign-up, no account Free forever

What is a Python file?

A .py file holds Python source code. Python is widely used for automation, data science, web back ends and teaching.

Scripts are often shared as plain files, and reading one before you run it is good practice.

Full namePython Source File
File extension.py
MIME typetext/x-python
Developed byGuido van Rossum (Python Software Foundation)
Introduced1991

How to open a Python file online

  1. Drop the file. Drag your .py file onto the panel at the top of this page, or click it to pick the file from your device.
  2. See it instantly. Your browser reads the file locally and shows the preview in a second or two.
  3. View full screen or download. Use the full screen button for a distraction-free view, or download a copy. Close the page when you are finished and nothing is kept.

How Drop and Open displays Python files

Drop and Open reads the file locally as UTF-8 text and shows it in a monospace block with line breaks preserved. The content is inserted as plain text, so nothing inside the file can run. No syntax highlighting is applied.

Good to know: The code is not executed and has no highlighting. Use an editor for navigation and linting.

What Python files are used for

  • Automation scripts
  • Data analysis code
  • Web back ends
  • Coursework and tutorials

Tips for working with Python files

  • Check for os.system, subprocess and eval in unknown scripts.
  • Python relies on indentation, so keep spaces consistent.
  • Use a virtual environment when installing dependencies.

Is it private to open a Python file here?

Yes. Drop and Open runs entirely in your browser. When you choose a file, the browser reads it into local memory and displays it. There is no upload, no account, and no server-side copy. You can check this by opening your browser's developer tools, watching the Network tab and dropping a file. Learn more in our guide to client-side and server-side viewers.

Python viewer questions

Is it safe to open a .py file?
Viewing it here is safe because it is not run. Running unknown scripts is risky.
How do I run it?
Install Python and use python file.py in a terminal.
What is a .pyc file?
Compiled Python bytecode. It cannot be read as text.
Is it uploaded?
No.