it's getting better : only slightly off the point.
Updated: 6/29/2005; 4:37:15 PM.

 

home
python ide
python.root
mailEdit docs
mailEdit.root
scripting news
python.org
python programmer weblogs
zope.org
accordion guy
daily python url
zope zen
bOingbOing
fark
russ lipton
cameron
ian bicking

Subscribe to "it's getting better" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

 
 

Sunday, February 17, 2002

Okay, so the bundling bit works fine, but I'm pulling my hair out about execution.

I think I'm going back to the framework, and just advise people to restart it if they think the environment has been corrupted.

On the other hand, I'm having a hell of a time trying to use sys.unixShellCommand to launch anything that calls back to Radio using XML-RPC.

It worked fine with the weirdo Python I used to have installed. I got it from here. It's a 35M download, and was built to be used with PyGame, a game framework for Python.

I may just recommend that particular Python for use on OS X.

Why is this weirdo build of Python the only version of Python on OS X that seems to sensibly support application launching?
11:36:30 PM    


I've been reminded that a bundle also introduces a level of scoping, and that it can improve performance.

It's a little harder doing the same thing in Python. I could get the scoping improvement by translating bundles into "if 1:", but I am unsure about whether that would actually make things worse.
7:28:09 PM    


I'm yet another radio guy that is playing with this.

What I'd really like is a way to make the notification happen in the other direction -- I want to be told that I need to update.

I suppose I could try the JavaScript version of XML-RPC. I could just call into some service that blocks if it doesn't have any information, or returns whatever has accumulated since the last call.
6:10:03 PM    


I've been reminded that a bundle also introduces a level of scoping, and that it can improve performance.

It's a little harder doing the same thing in Python. I could get the scoping improvement by translating bundles into "if 1:", but I am unsure about whether that would actually make things worse.
4:16:51 PM    


Question. I have a printer hooked to my Win2K box. I want to print to it from my OS X box. How do I do that? Do I need Win2K Server for Appletalk Services? If so, that sucks.
3:14:25 PM    

I hate it when I find these things.

It turns out I didn't have a standard install of Python on my machine. I thought I had MacPython installed, but when I tested it against the standard MacPython installation I discovered that it doesn't work with the launch.appWithDocument verb I was using in Radio.

So I'm going to make it work with the Fink version of python, and assume that it's installed in the standard Fink location of /sw/bin/python. I'll also include documentation that describes how to fix that path if it's wrong.

So here we go again. Sorry about that.
3:05:15 PM    


One of the features in UserTalk that I enjoy the most is the feature that I thought was the most useless when I first read about it.

It's the 'bundle' keyword. All it does is the equivalent of introducing a block of code.

That didn't make sense to me at first. UserTalk is customarily programmed in an outliner, and a block is introduced merely by making it a child of the 'if', 'while', 'case' or other keyword that requires a block. So all it really does is add a level of indentation to the code.

Which, as it turns out, was the key to why it's such a useful feature.

When you start mucking about in Frontier or Radio, you really don't get very far until you get comfortable with the programming environment that's been set up, since it is educational to poke around in the current code base. One of the things you start seeing is a lot of code that looks like this:

on whatever(s)
    bundle // what this phrase does
    bundle // what the next phrase does
    bundle // clean up the mess
    return (true)

...where the bundles have code in them, they're just collapsed in the outline.

When you use an outline, you can collapse bits of code so they don't get in the way of your thought. You can tag the bundle with a comment that summarizes what is going on, which makes it much easier to deal with the code. It's easy to take on big projects if you split them up into tiny pieces, and getting them out of your way visually really helps in keeping focused on the bigger picture. If you didn't have a 'bundle', you wouldn't have a way to break code into phrases that can be hidden. You're left with just adding whitespace to make some breathing room, but that soaks up vertical space that always seems to be in short supply. In an outliner, to make something hideable, it must be made a child.

It's a nuance you really don't get until you start using it.

Now that I'm programming Python in a browser, I've been missing being able to use bundles. Then it occurs to me -- I'm already rendering Python code from a browser, there's nothing keeping me from allowing someone to use a bundle keyword in the browser, and then just do the right thing when it's written out. I could have a 'bundle' in Python.

I think that little feature will slip into my Python Tool in the next minor release.
12:31:36 PM    


© Copyright 2005 David Brown.



Click here to visit the Radio UserLand website.
 


February 2002
Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28    
Jan   Mar