README for pyshell
==================

Pyshell is another shell application for python. However unless all
others it is not command-line based, but uses a concept which is
similar to the "notebooks" of mathematica and maple. It is maybe a
matter of taste. 

I commonly use the pyshell in three ways:
a. as stand-alone application
b. to debug pyhton applications while they are running
c. for scripting in the drawing program skencil

a) This requires a startup file. I am using a file 
/usr/bin/pyshell consisting of the single line 

python /usr/lib/python2.3/site-packages/pyshell/pyshell.py $@

b) I am usually using a hidden key combination such as control-shift-s 
   to pop up the pyshell window. The standard code launch the shell is 
   something like

    class Main:
        ...
    def open_shell(self):
        try:
            import pyshell
        except:
            return
        namespace = locals()
        namespace['self'] = self
        import Tkinter
        namespace['Tkinter'] = Tkinter
        shell = pyshell.open(namespace)

c) This is very cool for drawing e.g. using the turtle library, and also
   for debugging Skencil plugins and scripts. Basically, you can do everything
   which can be done by a script or a plugin directly using pyshell. The 
   command completion further allows to explore the inwards of Skencil.

   To install pyshell for usage with Skencil, one could do the following:
   >cd pyshell_sk-0-3
   >cp -r pyshell ~/.sketch/
   >cp pyshellstarter.py pyshell ~/.sketch/

   Then you need to add the following line to your userhooks.py file (have a
   look in the userguide if this is not clear)
   
   import pyshellstarter


   Comments: 
   Turtle drawing is best explained by example. I put a couple of them
   in the net under 
       http://de.geocities.com/dendronde/turtle.html 

   For developing scripts and plugins it is really not necessary to restart
   Skencil each time a change is made to the code. I am using something as 

     [In 5]:
     import MyScript
     [Out 5]:
     [In 6]:
     reload(MyScript)
     MyScript.MyFunction(context)
     [Out 6]:
     ...

   Executing (shift-enter) cell 6 then reloads and runs the script. 
 

Usage
-----

most important:
- right mouse button pops up a menu
- tab completes what you are typing. 
- a cell is executed by shift-enter

editing is as usual: 
- copy, paste, cut with Control-c, -v, -x
- undo redo with Control-z and Control-r
- control-i indents a block or a line
- control-u dedents a block or a line
- a history function is bound to control-up and control-down



