[python-win32] Request for comments
Tim Golden
mail at timgolden.me.uk
Tue May 27 16:00:04 CEST 2008
Mike Driscoll wrote:
> Tim Golden wrote:
>> Yes, I tried that to see what you meant. I'm not sure there's
>> much I'm going to be able to do about that, unless someone
>> jumps in with a solution. My main point about the examples is
>> that they're self-contained. (ie you don't need to prearrange
>> any data or install any modules unless indicated). The ability
>> to drop them into a Python interpreter window is a nice-to-have
>> which I make use of whenever I'm posting code.
>>
>> If anyone can suggest anything here, even in the form of a hint
>> in the docs, please let me know.
>
> Well, there's at least 2 ways around this.
>
> 1) Change it to: import win32api; import win32con (note the
> important semi-colon)
> 2) Change it to: import win32api, win32con
That's fine for two lines, but I can't change a whole script to work
that way :) The intepreter window in PythonWin just doesn't work
the same way as the conventional console-based one, it seems.
> However, any code that is more than one statement, I tend to copy into a
> blank file and save it before running it, which circumvents this issue
> entirely.
Fair enough, and I think that my main point is that the code can run
as-is, without needing any kind of setup. Pasting it direct into an
interpreter session is handy to check it runs, but it's not a must-have.
TJG
More information about the python-win32
mailing list