Why python use interpreter? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Why python use interpreter?

we all of know python 'Compiled interpreted' language in python first code is compiled then byte code is create and then this byte code is interpret but why we need to interpret.what we can not convert our high language code into machine code using only cpmpiler?

28th Sep 2018, 3:35 AM
Maninder $ingh
Maninder $ingh - avatar
1 Answer
0
A compiler is OS and hardware dependant, so the code has to be compiled again for each type of target machine. You need to have a compiler specific to that machine in order to create the executable, and then you need access to the target environment for testing and troubleshooting. The interpreter/runtime (for python , Perl, nodejs, java) is already compiled, optimised and tested for the target machine, and the actual python program runs (hopefully) the same way in all the environments where the interpreter is installed.
28th Sep 2018, 5:21 AM
ifl
ifl - avatar