[Tutor] Does python produces bytecode??

2007-01-05 Thread Asrarahmed Kadri

Hi Folks,

Just a bit curious about how python runs the program?

I do know that it does not compile the code; its an interpreted language.

Do we have something like Python virtual machine ??

Please hlep me to understand these things.


Regards,
Asrarahmed
--
To HIM you shall return.
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Does python produces bytecode??

2007-01-05 Thread Kent Johnson
Asrarahmed Kadri wrote:
 
 Hi Folks,
  
 Just a bit curious about how python runs the program?
  
 I do know that it does not compile the code; its an interpreted language.
  
 Do we have something like Python virtual machine ??
  
 Please hlep me to understand these things.

Yes, Python has a bytecode compiler and a virtual machine (bytecode 
interpreter). The compiler is invoked automatically when needed so it is 
not really apparent to a casual user.

The dis module in the standard library lets you see the bytecode 
representation of a function or other code. The docs for this module 
include a listing of all the bytecode instructions.

If you want to dig into the details you have to look at the C source 
code for Python. This page gives a high-level guide:
http://effbot.org/pyfaq/where-do-i-start-if-i-want-to-learn-about-the-cpython-implementation.htm

Kent

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor