Monday, October 14, 2013

Python Spyder, clear workspace/shell command

Python Spyder is a great Tool similar to Matlab but still lacking commands for clearing variables form workspace. I've added following code to the Spyder startup file (C:/Python27/Lib/site-packages/spyderlib/ to generate clear commands for workspace and the shell:

So whenever I type clear() or clear_all(), the command shell or the variables from the workspace will be cleared, respectively.


  1. good work! It would be even awesome if you had a piece of code which is easily copyable. Many thanks!

  2. Worked well on a Mac with python 2.7. Stopped working when I switch to python 3.4, any idea why that would be?