# Solved: How Does Python Work ?



## -Fabez- (Jul 28, 2008)

I have just downloaded the source code for Python, in an attempt to understand how interpreted languages work and I am reading through it now. However, I have several questions about how Python and interpreted languages in general work.

1) How do they determine which command is being given to them and handle it appropriately ?

2) Python is based upon C / C++, which does not support dynamic code evaluation and execution as it is a compiled language, so how does Python create create variables with the data provided by a user, dynamically execute code, etc ?

3) How does the Python interpreter execute Python code ?

4) How does Python make sure that the C / C++ code it is created works without fail ? Is everything wrapped in try and catch statements or is there a better way ?

Any help or answers to these questions would be greatly appreciated. Thanks -Fabez-


----------



## jdean (Jan 20, 2002)

Fabez, you are to be commended for trying to learn to swim, but it seems to me that you've jumped into the middle of the Pacific Ocean and that's just not the best starting point.

So much for the analogies; getting back to shore, I would strongly recommend a good class or a good book or both.

While I don't have any personal experience with it, MIT has a class built around the book "Structure and Interpretation of Computer Programs" and I think that this might be a reasonable starting point. You can find out more about this on wikipedia:

http://en.wikipedia.org/wiki/Structure_and_Interpretation_of_Computer_Programs

MIT has free online videos of many classes and I've heard that they are top notch. If the MIT class and/or book are not appropriate, I'm sure that there are many other alternatives out there.

You may find that some of this material seems theoretical but the idea is to gain a sound and fundamental foundation of computer science. Your questions demonstrate you are motivated and intelligent, and you would benefit greatly from a more thorough understanding. The resources are there, take advantage of them!

Good luck!


----------



## -Fabez- (Jul 28, 2008)

Thank you for the responce, your information was very valuable. I will look into book's and class's, in order to gain a better and more in depth understanding of this topic, before trying to swim in the middle of the Pacific Ocean  Once again, thanks. -Fabez-


----------



## jdean (Jan 20, 2002)

My pleasure. I have fond recollections of studying the foundations of computer science and I hope that you will be as fascinated as I was.


----------



## -Fabez- (Jul 28, 2008)

I'm marking this thread solved, also I'm confident I will enjoy studying computer science and be fascinated by it as awell


----------

