This is just a wondering I had while reading about interpreted and compiled languages.   Ruby is no doubt an interpreted language, since source code is processed by an interpreter at the point of execution.On the contrary C is a compiled language, as one have to compile the source code first according to the machine and then execute. This results is much faster execution.  Now coming to Python:  A python code (somefile.py) when imported creates a file (somefile.pyc) in the same directory. Let us say the import is done in a python shell or django module. After the import I change the code a bit and execute the imported functions again to find that it is still running the old code. This suggests that *.pyc files are compiled python files similar to executable created after compilation of a C file, though I can't execute *.pyc file directly.When the python file (somefile.py) is executed directly ( ./somefile.py or python somefile.py ) no .pyc file is created and the code is executed as is indicating interpreted behavior. These suggest that a python code is compiled every time it is imported in a new process to crate a .pyc while it is interpreted when directly executed. So which type of language should I consider it as? Interpreted or Compiled?And how does its efficiency compare to interpreted and compiled languages?According to wiki's Interpreted Languages page it is listed as a language compiled to Virtual Machine Code, what is meant by that?UpdateLooking at the answers it seems that there cannot be a perfect answer to my questions. Languages are not only interpreted or only compiled, but there is a spectrum of possibilities between interpreting and compiling.  Also, its not the languages which are interpreted or compiled, but rather their implementations either interpret or compile code.I also found out about Just in time compilation From the answers by aufather, mipadi, Lenny222, ykombinator, comments and wiki I found out that in python's major implementations it is compiled to bytecode, which is a highly compressed and optimized representation and is machine code for a virtual machine, which is implemented not in hardware, but in the bytecode interpreter.  As far as execution speed is concerned the various benchmarks cannot be perfect and depend on context and the task which is being performed.  Please let me know if I am wrong in my interpretations. 
Is Python Interpreted or Compiled?
programming languages;python;compiler;efficiency;interpreters
It's worth noting that languages are not interpreted or compiled, but rather language implementations either interpret or compile code. You noted that Ruby is an interpreted language, but you can compile Ruby  la MacRuby, so it's not always an interpreted language.Pretty much every Python implementation consists of an interpreter (rather than a compiler). The .pyc files you see are byte code for the Python virtual machine (similar to Java's .class files). They are not the same as the machine code generated by a C compiler for a native machine architecture. Some Python implementations, however, do consist of a just-in-time compiler that will compile Python byte code into native machine code.(I say pretty much every because I don't know of any native machine compilers for Python, but I don't want to claim that none exist anywhere.)