The Artima Developer Community
Sponsored Link

Python Buzz Forum
A Twisty Turny Thing

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Ben Last

Posts: 247
Nickname: benlast
Registered: May, 2004

Ben Last is no longer using Python.
A Twisty Turny Thing Posted: May 28, 2004 9:31 AM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Ben Last.
Original Post: A Twisty Turny Thing
Feed Title: The Law Of Unintended Consequences
Feed URL: http://benlast.livejournal.com/data/rss
Feed Description: The Law Of Unintended Consequences
Latest Python Buzz Posts
Latest Python Buzz Posts by Ben Last
Latest Posts From The Law Of Unintended Consequences

Advertisement
The BlackAdder quote in full is "You twist and turn like a ... twisty-turny thing", and I refer to the interesting contortions through which PythonWin goes in it's admittedly impressive attempts to be an IDE written in the same language that it supports. I've spent a fair amount of time in PythonWin over the last couple of weeks (when I say in, I mean interacting with it, not poring over the source code like Gandalf looking to identify the Ring[1]), using it to develop a crafty little system that generates questions from a database of "facts"[2]. It's the sort of batch process that, once kicked off, runs overnight, using around three thousand input records to generate several thousand output ones. Most of the heavy lifting happens in Python, which builds up networks of object to represent the datums and relationships therebetween. It's cool, and pretty memory-intensive.

So a lot of the think-write-read-run-debug cycle is done via PythonWin and, let me tell you, that little near-the-taskbar icon that lets you drop into running code is a blessing from whatever Gods watch over programmers. I remember missing the sublimely simple tactile trigger of Control-C when I first started using Windows (in those days I was more a VMS and Unix type of lifeform), the ability to, in effect, say "Oi! Program! No!" whenever one ran amuck. Windows doesn't give you that. You can, of course, try the little Fisher-Price "X" icon. Which sends the application a polite event to ask it, if it wouldn't mind, to be ever so terribly helpful and close. PythonWin in full flow doesn't respond, and not unreasonably so. You can then try the right-click-on-the-taskbar-wotsit, which tends to be doubly frustrating, since the menu pops up and down like... well, I'll let you supply your appropiate humourous metaphor here. Again, the Close option doesn't so much close as not. One yearns for the power of Control-C as one gives the three-finger-salute and conjures up Task Manager like some Demon from the nethermost slums of Pandemonium and commands it to End Process.

Or you can blithely click on the little coiled green snakey thing in the area of the screen that is apparently not called the System Tray really and choose to Break Into Running Code. I like that; there's a certain burglariousness about it, and it's satisfying to see the same old command-line-esque KeyboardInterrupt exception launched (I like to imagine) on a ballistic course to crash through the thicket of namespaces and pin the interpreter, writing and flailing, to the ground.

Anyway, none of this is the fault of PythonWin, which is really dead dead clever, but is written in Python. And thus contains the seeds of its own weakness, for occasionally, after Breaking Into that Running Code, a fountain of traceback bursts onto the interactive window (that's the window inside the PythonWin window, not the PythonWin window itself, which is a container window for the other window, to be clear) and after that, all bets are off. Now clicking the X or choosing to Close will result in just another traceback, and another, one per click. The Window That Would Not Die. For, of course, as well as my code running, PythonWin itself is also running, so that KeyboardInterrupt missile is as likely to clobber the one as the other.

But I do like PythonWin, genuinely I do.

[1] You can assume from this that, like many other LOTR fans, I celebrated the release of The Return Of The King by watching the whole lot over several evenings. Let joy be unconfined.
[2] As per usual, I omit the identifying details of what I'm actually working on because, hey, I signed NDAs too, you know.

Read: A Twisty Turny Thing

Topic: Computer Language Fireworks Previous Topic   Next Topic Topic: Find Bugs with FindBugs

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use