Differences between revisions 2 and 3
Revision 2 as of 2006-01-02 05:43:48
Size: 3514
Editor: 66
Comment:
Revision 3 as of 2006-01-02 05:47:44
Size: 3889
Editor: 66
Comment:
Deletions are marked like this. Additions are marked like this.
Line 18: Line 18:
I have a hard time understanding what the modules are for; There's a lot of focus on ''how'' these things work, but I have difficulty figuring out what they are for.
It seems to me that Edit is something that makes it so that you can jump straight to where a variable is defined, in IDLE. (Not really sure.) If so, that's awesome! I've often times wished IDLE were more powerful; This is the kind of thing I'd like to see more of. :)

-- LionKimbro [[DateTime(2005-04-01T21:16:29Z)]]
Line 34: Line 37:
I have a hard time understanding what the modules are for; There's a lot of focus on ''how'' these things work, but I have difficulty figuring out what they are for.

-- LionKimbro [[DateTime(2005-04-01T21:16:29Z)]]

My more-interesting modules include "[:/Modules/Alias: Alias]", "[:/Modules/Edit: Edit]", and "[:/Modules/UT: UT]". I'll add others to this page as I have opportunity.

General Outlines

  • attachment:Alias.py
    • Provides a mechanism whereby arbitrary callables are *effectively* converted to commands in interactive Python, but not in modules. To do this, Alias splits off the first word of the command line, attempts to evaluate it, and iff it is callable, the tail of the command is also evaluated and passed to the callable as an argument tuple. This allows the manual use of "dir", "reload", et al, as statements without requiring that parentheses be typed. Parentheses are still required in module source, however, and in any function calls in the tail of the command line.
    • Provides a mechanism whereby arbitrary one-word names may be assigned to callable objects for use with the preceding mechanism. This allows one to dispense with the requirement to type fully-qualified long.nested.module.names for selected callables, and is where the module gets its name.
    • Provides a mechanism for allowing modules to be imported through a bare reference to the module name.
    • Provides a mechanism whereby modules imported by the preceding mechanism may auto-register aliases of their own choosing. Entering the name of a module that has already been imported does not re-import the module; rather it re-updates whatever auto-alias associations might exist in that module at the time the name is re-entered.
    • Provides its own list of aliases, available via the preceding mechanism, for managing the alias dictionary.
    • Does not function under IDLE without disabling the default sub-process. Probably does not function correctly, or even at all, without IDLE.


  • attachment:Edit.py
    • Provides an Alias that attempts to open for editing the source for the module where the argument was defined, positioned, if possible, on the line where the definition starts.
    • Provides a mechanism for recording the current size and position of the active IDLE window such that subsequent attempts to open the window open it with the remembered geometry.
    • Provides an IDLE menu item to trigger the preceding mechanism.
    • Functions only under IDLE. Does not function correctly without disabling the default sub-process.

It seems to me that Edit is something that makes it so that you can jump straight to where a variable is defined, in IDLE. (Not really sure.) If so, that's awesome! I've often times wished IDLE were more powerful; This is the kind of thing I'd like to see more of. :)

-- LionKimbro DateTime(2005-04-01T21:16:29Z)


  • attachment:UT.py - last uploaded 2005-11-26.
    • Provides several "utility" functions that I've found useful:
    • A "smart" reload substitute that can automatically re-load other modules in dependancy-order, if the module being reloaded registers its dependancies, with convenience functions for declaring those dependancies.
    • A convenience wrapper for cPickle that allows [un-]pickling single objects from/to a specified file with a single function call.
    • ThisLine, a function that returns the name and source line-number of the caller an arbitrary number of callers up the call-stack.

    • Some old stuff, commented out.


  • attachment:GWiz.py, a ""functional"" but incomplete GUI editor. More details later.


  • attachment:WinReg.py, a higher-level abstraction around _winreg. Fully functional and complete.


I hereby offer any modules that ""I"" attach to this page for inclusion in the official Python module library.


Comments

I have a hard time understanding what the modules are for; There's a lot of focus on how these things work, but I have difficulty figuring out what they are for.

-- LionKimbro DateTime(2005-04-01T21:16:29Z)

lwickjr/Modules (last edited 2008-11-15 14:00:04 by localhost)

Unable to edit the page? See the FrontPage for instructions.