Here's what the workspace does for you:
Unlike with (at least some) IDEs, editing is not module oriented. This is an advantage when you are tinkering and a disadvantage when you are building something large.
Saving the workspace means to place a memory of the current workspace in the current folder. Do it this way
>>> save() >>>
To load the saved workspace you do this
. >>> load() >>>You will be asked if you want to delete everything in the current workspace before you load the saved one.
What to do if you do not want to save all the variables in your current workspace? Delete the ones you do not want. For example,
>>> z = -1 >>> z -1 >>> del zAfter you delete z, it is gone and you get an error message if you try to use it.
>>> z Traceback (most recent call last): File "<stdin>", line 1, in ? NameError: name 'z' is not defined >>>
What do you do if you want to trash the saved workspace?
>>> clearSavedWorkspace() >>>Clearing the saved workspace does not affect the variables, functions, and classes that are currently defined in your workspace. Deleting these things from your current workspace does not affect what is in the saved workspace.
How can you remember which variables are in the current workspace? If you are me, you cannot. So ask
>>> savable() Global Variables: ['x','y'] Functions: [] Classes: [] >>>In this case there are two savable variables, named “x” and “y”. There are no savable functions, or classes.
Here the rules for what is savable: Variables
Functions
Classes
Instead of typing def and class definitions directly into the command line interpreter, you can use the edit command. Execute
>>> edit()What you will see is a new window something like this
Enter a single function or class definition into the top part of this window. The check button compiles it and shows messages in the bottom part. (If necessary, you can scroll with the arrow keys.)
Compiling from this window is required if you are to load your definition back into the Python interpreter. The window is modal, you cannot use the command line window until you are finished with it. (You can, however, use windows from other applications.)
Advantages:
>>> edit(foo)
Enjoy!
Comments can be sent to me thru my home page jazimmer.net