May-09-2017, 08:33 PM
Hi all,
My question is a bit general, but for some reason I couldn't find any answer for it online.
I know that python is mostly an interpreted language.
Usually an interpreted language (as far as I know) is running one line at a time, each line being translated into machine code and then moving on to the next line...
I also know that you can use py_compile module in order to first compile your code into byte-code and then run it (being interpreted into machine code).
My question is as follows, does python only compile into byte-code when i specifically ask for it using py_compile?
or if I just run a python file (from cmd or even pycharm) it will also convert my code into byte-code first?
Thanks in advance,
Nirel.
My question is a bit general, but for some reason I couldn't find any answer for it online.
I know that python is mostly an interpreted language.
Usually an interpreted language (as far as I know) is running one line at a time, each line being translated into machine code and then moving on to the next line...
I also know that you can use py_compile module in order to first compile your code into byte-code and then run it (being interpreted into machine code).
My question is as follows, does python only compile into byte-code when i specifically ask for it using py_compile?
or if I just run a python file (from cmd or even pycharm) it will also convert my code into byte-code first?
Thanks in advance,
Nirel.