On Thu, Apr 10, 2008 at 08:44:39AM -0500, Edward K. Ream wrote:
> For programming projects, I organize my master .leo file in two ways: by
> topic (Notes, Projects, To Do) and by file.  I use @thin files like
> leoNotes.txt, leoProjects.txt, leoToDo.txt and leoToDoLater.txt to keep the
> actual .leo file small: all the data are in thin .txt or thin .py files, so
> leoPy.leo remains very small.

I do the same thing now. I create a master .leo file which is kind of
a scratch pad along with being a container for the final code, unit
tests and documentation.

> I use @all in the .txt files so that I can clone nodes from the .py files
> and put the clone in the .txt file.  However, I *strongly* recommend that
> you do not use clones in .py files to duplicate code. Imo, this is extremely
> bad style, at least for Python.  For languages such as html, that do not
> have functions, using clones to duplicate code is less bad style :-)

That is an interesting idea. Cloning python code snippets into a text
file (for additional commenting, documentation, to go long with a bug
hunt, etc.)

> 1. Write scripts in the body pane, and use execute-script (or use a script
> button).
> 
> 2. Create .py files on the file system (with @thin) and then leave Leo and
> execute those files.  On xp, I use .bat files to make this simple.
> Similarly, on Linux I use executable batch files.

Or another possible workflow (which is what I use now on both WinXP and Linux)
that can be thought of as a variant of #2:

3. Create .py files (using @thin) and then use the IPython plugin to drop
into an ILeo session (Leo + IPython), where I can interactively play
with my python code (import a file, play with its classes, test out my
ideas), then update the code in Leo and back in ILeo, just "reload" the module
and continue playing, ad infinitum. I get all the power of IPython (tab
completion of class elements, etc.) alongside my Leo environment.

I want to publicly thank Edward and Ville for their work on integrating
Leo and IPython. ILeo makes programming in python very fun!

-- 
Kayvan A. Sylvan          | Proud husband of       | Father to my kids:
Sylvan Associates, Inc.   | Laura Isabella Sylvan, | Katherine Yelena (8/8/89)
http://sylvan.com/~kayvan | my beautiful Queen.    | Robin Gregory (2/28/92)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to