Anshul Shah
Anshul Shah

Reputation: 3

How to find IDLE source code (idlelib) in Mac?

I'm trying to develop a custom extension for IDLE and have been following instructions to add my extension code to the idlelib folder and update the config-extensions.def file. However, I am on a Mac, and I understand these files are hidden from viewing. Curerntly, I'm able to edit the config-extensions.def file from my terminal (picture below), but I am unsure of where the rest of the source code is for launching IDLE, as I am unable to find the idlelib directory that has files such as zzdummy.py (the example extension for IDLE). It is my understanding that I need to add my custom extension file (called test.py) to the folder where the rest of this idle source code is located. I need help locating this folder on a Mac so I can add my file to the correct location.

In the picture below, I'm only able to see these four files (test.py is a file I added). However, I cannot locate the directory where I need to actually put my test.py file.

config-extensions in my terminal

Upvotes: 0

Views: 539

Answers (1)

Terry Jan Reedy
Terry Jan Reedy

Reputation: 19174

~/.idlerc/... has user specific settings. Notice config-main.cfg with user configurations. config-main.def with defaults is in <install-dir>/Lib/idlelib,, which also has IDLE's .py files. In IDLE, File => Open module brings up a dialog box. Enter idlelib.idle and it will load .../Lib/idlelib/idle.py and the title bar should have the complete path where your custom extension should go.

Upvotes: 1

Related Questions