Associate Python Files with IDLE

See Python: Tips and Tricks for similar articles.

To make it easier to open files directly into IDLE from Windows Explorer, you can associate all Python files with IDLE in Windows. As IDLE doesn’t come up as one of the default options for editing Python, it’s not as intuitive as it might be, but it’s pretty simple. Here’s how you do it:

To associate Python files with IDLE on Windows:

  1. Go to a folder that contains a Python file.
  2. Right-click on any Python file.
  3. Select Properties.
  4. Next to the section that says “Opens with”, click the Change button.
  5. You may need to select More Options.
  6. Click Look for another app on this PC.
  7. Navigate to where you installed Python. If you don’t know where that is, see How to find all your Python installations on Windows.
  8. Open Lib
  9. Open idlelib
  10. Select the idle.bat file.
  11. Click Open.
  12. Click OK to close out of Properties.
  13. Now you can open .py files in IDLE simply by double-clicking on them.

Written by Nat Dunn.

Related Articles

  1. Using Python to Convert Images to WEBP
  2. Scientific Notation in Python
  3. Understanding Python’s __main__ variable
  4. Bulk Convert Python files to IPython Notebook Files (py to ipynb conversion)
  5. Python Clocks Explained
  6. Python: isdigit() vs. isdecimal()
  7. Maximum recursion depth exceeded while calling a Python object
  8. When to use Static Methods in Python? Never
  9. Finally, a use case for finally – Python Exception Handling
  10. Python Coding Challenge: Two People with the Same Birthday
  11. How to Create a Simple Simulation in Python – Numeric Data
  12. Collatz Conjecture in Python
  13. Associate Python Files with IDLE (this article)
  14. How to find all your Python installations on Windows (and Mac)
  15. Python Color Constants Module
  16. A Python Model for Ping Pong Matches
  17. pow(x, y, z) more efficient than x**y % z and other options
  18. Python’s date.strftime() slower than str(), split, unpack, and concatenate?
  19. Bi-directional Dictionary in Python
  20. Creating an Email Decorator with Python and AWS
  21. Change Default autosave Interval in JupyterLab
  22. Converting Leading Tabs to Spaces with Python
  23. Basic Python Programming Exercise: A Penny Doubled Every Day
  24. Simple Python Script for Extracting Text from an SRT File
  25. Python Virtual Environments with venv
  26. Mapping python to Python 3 on Your Mac
  27. How to Make IDLE the Default Editor for Python Files on Windows
  28. How to Do Ternary Operator Assignment in Python
  29. How to Convert Seconds to Years with Python
  30. How to Create a Python Package
  31. How to Read a File with Python
  32. How to Check the Operating System with Python
  33. How to Use enumerate() to Print a Numbered List in Python
  34. How to Repeatedly Append to a String in Python
  35. Checking your Sitemap for Broken Links with Python
  36. How to do Simultaneous Assignment in Python
  37. Visual Studio Code - Opening Files with Python open()
  38. How to Slice Strings in Python
  39. How Python Finds Imported Modules
  40. How to Merge Dictionaries in Python
  41. How to Index Strings in Python
  42. How to Create a Tuple in Python