Python Complied or Interpreted ??

thinking_man_PNG11587.png (658×650) (

We normally use python editors where one click makes our program run. So we don't know what exactly happens behind the hood.

Today we are going on a new journey to find the reality behind program execution!

This time we just need a python editor, command prompt and the _pycache_ folder to get this all done !

🚶Without any further ado, let's begin our journey🚶

  1. First of all write a python program and save into your PC with a file name.

2. Now we need our CMD to locate this file and compile it. Yup, Compile !!

Compilation syntax — python -m py_compile

3. Once compilation is done there will be a folder created to hold cpython file (in my case _pycache_)

4. Now we will interpret or execute the cpython file

Execution syntax — python filename.pyc

Now, as we have seen the python compilation and interpretation with our eyes lets say “Python is both compiled and interpreted language”

Hope you liked this wonderful journey !

Happy learning !




Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store