leo.py is Leo2 written in Python and Tk. It should work on any platform that supports Python 2.2 or later and Tk 8.3 or later. The Borland version of Leo runs under Windows 95/98/Me/XP/NT.
import leo leo.run() # runs leo.py, opening a new outline.leo.go() # runs leo.py after reloading all modules.leo.open(fileName) # runs leo.py, reloads all modules, and opens fileName.
For leo.py: Leo is distributed as a single compressed folder. Simply uncompress this folder and run leo.py. You can run leo.py by double-clicking leo.py. You can also run leo.py from a Python interpreter as follows:
import leo leo.run() # runs leo.py, opening a new outline. leo.go() # runs leo.py after reloading all modules. leo.open(fileName) # runs leo.py, reloads all modules, and opens fileName.
leo.py 2.4 and above will open .leo files automatically provided that you associate leo.py with .leo files. Here is how to open leo.py when double-clicking a .leo file on Windows 2K or XP. I'm not sure it will work for Windows 95/98/Me.
In Windows 2K or XP, Go to Start->Settings->Control panel, open the "Folder Options" applet. Select the "file types" tab from the Folder Options window. Press the "new" button. Enter LEO into the "Create New Extension" File Extension text field. Press OK.
With LEO still highlighted in the Registered File Types list box, press the Advanced button. Change the default file type field to something like "Leo Literate Outline", press the Icon button and browse to the LeoDoc icon in your [leo installdir]\leo-2.3\Icons folder. Click OK. This gets the icons right and registers the description of the .leo file.
You now have to tell windows what to do to open the file properly. Press the new button to open the "New Action" window. In the Action field type Open. In the "Action used to perform action" type:
[python install dir]\pythonw.exe [leo install dir]\leo.py %1
You should now be able to double click on a leo file in explorer with leo.py. If you like to see the DOS window open, use python.exe rather than pythonw.exe in the above. This is useful for seeing exceptions; if you don't have the DOS window open Leo will just go away if an uncaught exception happens.
For the Borland version of Leo: The Icons folder contains two Icons, called LeoApp and LeoDoc, that represent the Leo application and Leo documents respectively. In Windows, to associate LeoDoc with .leo files, open the Setting:Folder Options:File Type panel, create an entry for .leo files. Then choose Change Icon and select the LeoDoc icon. Associate leo.py as the application to open .leo files.
This is the minimum you need to use Leo effectively.