title: Automatically convert jupyter notebook to .py
body: <p>I know there have been a few questions about this but I have not found anything robust enough.</p>
  
  <p>Currently I am using, from terminal, a command that creates .py, then moves them to another folder:</p>
  
  <pre><code>jupyter nbconvert --to script '/folder/notebooks/notebook.ipynb' &amp;&amp;  \
  mv ./folder/notebooks/*.py ./folder/python_scripts &amp;&amp; \
  </code></pre>
  
  <p>The workflow then is to code in a notebook, check with <code>git status</code> what changed since last commit, create a potentially huge number of <code>nbconvert</code> commands, then move them all.</p>
  
  <p>I would like to use something like <code>!jupyter nbconvert --to script</code>found <a href="https://stackoverflow.com/a/19779226/6028947">in this answer</a>, but without the cell that crates the python file appearing in the .py itself.</p>
  
  <p>Because if that line appears, my code won't ever work right.</p>
  
  <p>So, is there a proper way of dealing with this problem? One that can be automated, and not manually copying files names, creating the command, executing and then starting again.</p>