We all know we will save the Python files with .py. This .py file contains the actual source code of the each python program.
The More about the Python .py and .pyc files are below
How Python works?
Simple Python Example
def recursive_sum(n): # change this value for a different result if number < 0: |
Output
$python3 main.py
The sum is 253
If we store this program with the name "sample",then it will be stored as "sample.py" when we run a sample.py file, compiler creates a sample.pyc file once the code is executed it first executes .py file where as code is first turned into byte code by the compiler in the form of "sample.pyc” file
Read Also
Article Contributed By :
|
|
|
|
2986 Views |