Menu

From where is the curses library loaded

Reddit r/learnpython·u/9mHoq7ar4Z·6 months ago
#SS0wzUvN
#curses#library#loaded#python#article
Reading 0:00
15s threshold

Hi,

I'm learning the curses library but I noticed when looking at the source I don't really understand how it is loaded.

For example I would like to understand where the initscr() method is defined.

I look at the Python curses module documentation page at https://docs.python.org/3/library/curses.html#module-curses . From there it states that the source code is available at https://github.com/python/cpython/tree/3.14/Lib/curses .

When I open the source code link I navigate to the __init__.py file and find that the initscr() method is effectively from a module called _curses.

Can someone help explain to me where this is loaded from?

Thanks