title: Load spydata file
body: <p>I'm coming from R + Rstudio. In RStudio, you can save objects to an <code>.RData</code> file using <a href="https://stat.ethz.ch/R-manual/R-devel/library/base/html/save.html" rel="nofollow noreferrer">save()</a></p>
  
  <pre><code>save(object_to_save, file = "C:/path/where/RData/file/will/be/saved.RData")
  </code></pre>
  
  <p>You can then <a href="https://stat.ethz.ch/R-manual/R-devel/library/base/html/load.html" rel="nofollow noreferrer">load()</a> the objects :</p>
  
  <pre><code>load(file = "C:/path/where/RData/file/was/saved.RData")
  </code></pre>
  
  <p>I'm now using Spyder and Python3, and I was wondering if the same thing is possible.</p>
  
  <p>I'm aware everything in the globalenv can be saved to a <code>.spydata</code> using this :</p>
  
  <p><a href="https://i.stack.imgur.com/USnnp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/USnnp.png" alt="spyder save load spydata"></a></p>
  
  <p>But I'm looking for a way to save to a <code>.spydata</code> file in the code. Basically, just the code under the buttons. </p>
  
  <p>Bonus points if the answer includes a way to save an object (or multiple objects) and not the whole env.</p>
  
  <p>(Please note I'm not looking for an answer using <code>pickle</code> or <code>shelve</code>, but really something similar to <code>R</code>'s <code>load()</code> and <code>save()</code>.)</p>