compile python to pyc
import py_compile
py_compile.compile('yourFile.py')
# the compiled file will be saved as yourfile.pyc in a __pycache__ folder, which will be created the same folder as yourfile.py
compile python to pyc
import py_compile
py_compile.compile('yourFile.py')
# the compiled file will be saved as yourfile.pyc in a __pycache__ folder, which will be created the same folder as yourfile.py
is python interpreted or compiled
--Is Python interpreted or compiled?--
First, some definitions:
-An interpreted language reads your code line by line,
and executes them as they are read
-A compiled language converts *all* of your code into
another form first. Note, the other form does not have
to be machine code! This could be bytecode too.
Python is both compiled and interpreted. Python actually
converts your code into bytecode first (for example, .pyc),
then interprets your code. You might hear people call
Python "interpreted", but you would know that they are not
completely correct.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us