title: How to compile python program ( convert to pyc) in python3
body: <p>There are two ways to generate pyc in python2:</p>
  
  <p>1.</p>
  
  <pre><code>import py_compile
  py_compile.compile("file.py")
  </code></pre>
  
  <p>2.</p>
  
  <p><code>python -m compileall ./</code></p>
  
  <p>How to do it python3? I tried both of the above approaches, both are not generating .pyc file in python3. Please help.</p>