title: What is the difference between .py and .pyc files?
body: <p>I have noticed <code>.pyc</code> files spontaneously being generated when some <code>.py</code> file of the same name gets run. What is the difference between <code>.py</code> and <code>.pyc</code> files? </p>
  
  <p>Also, I find that having <code>.pyc</code> files lying around clutters up space. Should one delete <code>.pyc</code> files? Or is there a benefit and/or necessity to having them around?</p>
  
  <p>UPDATE: Here are 2 answered questions that are related to my question</p>
  
  <p><a href="https://stackoverflow.com/questions/2998215/if-python-is-interpreted-what-are-pyc-files">If Python is interpreted, what are .pyc files?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/3878479/python-pyc-files-main-file-not-compiled">Why are main runnable Python scripts not compiled to pyc files like modules?</a></p>
  
  <p><strong>This Question is not a Duplicate</strong></p>
  
  <p><em>Reason 1: Because I am asking what the difference between these two files are. The question S.Lott found named 'If Python is interpreted, what are .pyc files?' is not asking what the difference between .py and .pyc files are. It is asking what .pyc files are.</em></p>
  
  <p><em>Reason 2: Because my secondary questions 'Should one delete <code>.pyc</code> files? Or is there a benefit and/or necessity to having them around?' provide even more information on .pyc files and how one should handle them.</em> </p>
  
  <p><em>Reason 3: Because when a beginner Python programmer like myself wants to find out <strong>What is the difference between .py and .pyc files?</strong> , they will have no problem finding out the answer as they will be guided directly to my question. This helps reduce search time since the question is right to the point.</em></p>