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/scientific_startup.py) 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.



4 comments:

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

    ReplyDelete
  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?

    ReplyDelete
  3. Are you python developer?
    Here is difference between spyder vs jupyter to know.

    ReplyDelete