Skip to main content

Posts

Showing posts with the label programming python

Soft Announcement: Trapdoor Prototype

Previously I made a little preview of something I'm announcing today, but it is a soft announcement as I've had it on github for some time, but I haven't done anything with the project. This is just a prototype, an experiment, and it is called Trapdoor. I don't remember why I named it Trapdoor. Trapdoor has a simple concept, along the lines of Mozilla Prism. I wanted to take things I use to build web applications and test how they could be applied to building desktop applications. This meant two things: 1) I need to wrap up a web application in something that can be run locally. 2) I need some way to extend a web application in ways that normally only desktop applications can provide. This has been done in the simplest way I could find, at the time, and is available on github . extensions :   - calculator.Calculator js :   - calculator.js plugins :   - trapdoor.contrib.windowmanager Applications are configured through this si...

The Implied Module Path

We all know there is an implied path to import from for the main module, but it seems a few people get mixed about the details of how this works. In particular, it seems that this path is being confused for the current working directory . Here is a little note to help remember the distinction. Any module implicitly can import packages and modules in the same directory its file resides in, which is os.path.dirname(the_module.__file__) Often you run a script, when starting out, from its own directory, so that this implied path is the current working directory . This fact is purely a coincidence. The result boils down simply to understanding that any import can be relative to the module it appears in , and if you run a local (not system-wide available) script, that just happens to be your current directory, by coincidence.