What happens behind the scenes when we invoke the python prompt?
I am more interested in understanding how do the methods/functions like print, import and the likes load up in the interpreter?
EDIT: Some clarification on my question:
When we type python on our unix prompt/windows console and Hit enter, what are the libraries that get loaded. My specific interest is as to how the keywords like print and import are made available to the user.
Like you , I am very interested by the underlying mechanisms of Python. I think you'll love this series: http://tech.blog.aknin.name/category/my-projects/pythons-innards/
There are too many levels to that question. Here's a very rough sketch.
There's the whole C-level interpreter initialization, a bunch of in-the-interpreter tasks, reading the environment and options, customization of the interpreter session. All that defines what you see when you run python
.
I know there's a good description of the whole process somewhere.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With