Click the "Select File" button above, and choose your PY file.
You’ll see a preview, if available.
Click the "Convert file to..." button to extract text information.
Convert PY to another file type
To convert PY scripts to another format, you need Python or other Developer software.
Convert a file to PY
To convert other file formats to the "Source Code File" file type, you need software like Python or a similar tool.
About PY files
A .PY file is a plain text document containing source code written in the Python programming language. These files are designed to be read and executed by the Python interpreter to run backend software, automate administrative tasks, or train machine learning models. In a more specialized context, .PY files are also used as game logic scripts by the Ren'Py Visual Novel Engine.
You can natively open or edit these files using specialized Integrated Development Environments (IDEs) like PyCharm, Visual Studio Code, or basic text editors like Notepad++. You can read more about the language's history on Wikipedia.
Despite being simple text, .PY files come with severe workflow limitations for non-developers. Because they contain executable instructions, nearly all enterprise firewalls, network security tools, and email providers (like Gmail and Outlook) automatically block .PY file attachments to prevent malware distribution. Furthermore, double-clicking a .PY file on a computer without the Python interpreter installed will just result in an unrecognized file error, making direct sharing highly impractical.
To bypass these security restrictions and ensure readability, you must convert the file. For quick, secure sharing over email or chat, convert to TXT. If you need to present the code for client review, archiving, or printing, convert to PDF to lock the formatting. For publishing code snippets online, convert to HTML. Drop your file here to view and convert it securely right in your browser.
Convert.Guru analyzes your PY file, detects the exact format, and lets you read the text inside.
If you want to convert PY file to IPYNB, EXE, PDF, PYC, TXT, APK, JS, TS, JAVA, CPP, C or CS, you can use Python or similar software from the "Python Source Code Execution" category. In the File menu, look for Save As… or Export….
To convert SH, KT, PS1, SWIFT, LUA, PL, JAVA, SCALA, JS, VBS, TS or RS files to PY, try Python or another comparable tool in the "Python Source Code Execution" category.
The PY Converter Story
The history of Convert.Guru began over 25 years ago in California with Tom Simondi’s file-format database. A former contributor to Space Shuttle development and a software pioneer of the 1980s, Simondi established a trusted resource for file type analysis that was even referenced by Microsoft Windows XP. Today, we use modern technology to process and convert thousands of file formats while continually improving our PY converter.