Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Some basic clarifications about Python?

Tags:

python

jython

Last night I came across the term called Jython which was kind of new to me so I started reading about it only to add more to my confusion about Python in general. I have never really used Python either. So here is what I am confused about.

  1. Python is implemented in C - Does that mean that the interpreter was written in C or does the interpreter convert Python source code into C?

  2. CPython is nothing but the original Python & the term was just coined to later distinguish it from Jython - true or false?

  3. Now that Python is implemented in C (not really sure what that means), but does that mean python can be seamlessly integrated with any C code.

  4. Is Jython like a new programming language or does its syntax & other programming constructs look exactly similar to the original python? or is it just python which can be integrated with java code?

  5. If none of my above questions answer the difference between Python & Jython, what is it?

like image 974
EsotericMe Avatar asked Jan 29 '11 13:01

EsotericMe


People also ask

What is the base language of Python?

Python is written in C (actually the default implementation is called CPython).

Which type of programming does Python support *?

2. Which type of Programming does Python support? Explanation: Python is an interpreted programming language, which supports object-oriented, structured, and functional programming.


1 Answers

"Python" is the name of the language itself, not of a particular interpreter implementation, just as "C" is the name of a programming language and not of a particular compiler.

"CPython" is an implementation of an interpreter of the Python language written in C. It compiles Python source code to byte code and interprets the byte code. It's the oldest and reference implementation of the Python language.

"Jython" is another implementation of the Python language. It translates Python code to Java byte code, which can be executed on a Java virtual machine.

like image 145
Sven Marnach Avatar answered Oct 19 '22 02:10

Sven Marnach