pywin32 and docs
Surely not a new topic but… There was a thread yesterday on then python mailing list which turned on how to access the Desktop folder under Windows. This is actually a fairly frequently-asked question, but when I tried a few queries against Google, even targetting msdn directly, no clear answers emerged. (I was pretending I didn’t know what to look for, just using phrases like “find desktop folder”).
Once an answer was given, the OP asked how one knew where to look for that kind of information and pointed out that the pywin32 docs are hard to find things in. This is a hardy perennial and people have tried to form wikis and knowledge bases and so on, but nothing’s ever really taken off. Mike Driscoll, in the same thread, said he would try to pursue more vigorously the initiative he started before the summer (which I can’t find a link for now: sorry, Mike). These things need a lot of energy though. I keep an occasionally-updated series of Win32 how-do-I pages which I hope are useful but much more is needed.
Part of the issue is that pywin32 — without which Python under Windows would be a much much less powerful thing — does little more than wrap the underlying API with the necessary Python plumbing. So a lot of the time, a question like “How do I do X using Python under Windows?” is really better phrased “How do I X under Windows? And how do I translate the answer into Python?”. Not infrequently I answer questions on the Python and Python-Win32 lists by Googling for a non-Python answer and then translating. No expertise on my part beyond quite a few years’ experience in tracking down Windows APIs which can give me a few words to look for.
No real answers here: ctypes has the same problems, only more so, since it doesn’t even do the plumbing for you. There are a few Windows-specific modules around, including my own. But Python’s history and present is very much *nix-oriented and the balance of expertise tends to be over there. (Along, in some cases, with the dismissive attitude as soon as Microsoft technologies are mentioned).
I see it as my mission (of sorts) to champion Python as a force for much good under Windows: I try to pick up any Windows-specific questions on the lists, even if only to show willing. And I know I’m by no means alone in this. We just need a little more effort in making the darker corners of Windows clearer to innocent Pythoneers. My feeling is that recipes are the way to go (hence the How-do-I? series) but I’d welcome any initiative which had staying power.