r/PythonLearning 9h ago

Discussion Weird Folder names in Python

I always has a doubt after installing python software. When I open the Python folder, I see other folders with names like DLLs, Doc, etc, Include, Lib, Libs, Scripts, Share, Tcl, and Tools. Can anyone explain what these folders are, what they're for, and what the .pyd extension means?

1 Upvotes

2 comments sorted by

1

u/SCD_minecraft 6h ago edited 6h ago

Folders:

DLLs is folder with compiled libraries for languages like C. It contains functions that python needs to operate. In this case it also contains .pyd files

Doc is short for documentation

Include is folder with header files for CPython (for writing python libraries in C)

Lib is python standard library - things like random or math

Libs, tcl, man and share is i have no idea what, some internal working of python, don't touch it

Scripts is for python scripts compiled down to exe

Extension:

.dll - compiled library

.pyd - conpiled library, but for python

.pyi - stub file, that's what is used to provide typehints and autocomplete for libraries defined in C

.pyc - python code compiled to bytecode - that's what actually gets executed by the interpreter. Unlike exe files, it needs python installed

And btw, update your python. We are getting 3.15 soon, you are still on 3.11. Python is generally backwards compatible so no real reason to stay back. Not to mention 3.11 is on its End of Life cycle - no bug fixes, no nothing, only security updates and even that only till 2028